Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
omniauth and user models (this is just for demo)
#app/models/user.rb
class User < ActiveRecord::Base
has_many :authorizations, :dependent => :destroy
end
#app/models/authorization.rb
class Authorization < ActiveRecord::Base
belongs_to :user
validates_presence_of :user_id, :uid, :provider
validates_uniqueness_of :uid, :scope => :provider
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.