jam-cloud/ruby/lib/jam_ruby/models/user_authorization.rb

19 lines
451 B
Ruby

module JamRuby
class UserAuthorization < ActiveRecord::Base
attr_accessible :provider, :uid, :token, :token_expiration, :secret
self.table_name = "user_authorizations"
self.primary_key = 'id'
belongs_to :user, :class_name => "JamRuby::User", :foreign_key => "user_id"
validates :provider, :uid, :presence => true
validates_uniqueness_of :uid, scope: :provider
# token and token_expiration can be missing
end
end