Sha256: 56e2f225a93b1e3961e87ae8a3754f7117353443cd1e2b8d56ea002a885688ad
Contents?: true
Size: 549 Bytes
Versions: 13
Compression:
Stored size: 549 Bytes
Contents
class Client < ActiveRecord::Base has_many :access_tokens has_many :refresh_tokens before_validation :init_identifier, :on => :create, :unless => :identifier? before_validation :init_secret, :on => :create, :unless => :secret? validates :name, :website, :redirect_uri, :secret, :presence => true validates :identifier, :presence => true, :uniqueness => true private def init_identifier self.identifier = Devise::Oauth2Providable.random_id end def init_secret self.secret = Devise::Oauth2Providable.random_id end end
Version data entries
13 entries across 13 versions & 1 rubygems