Sha256: b0633a9bf012e5677a89fb26844c43ec56114ea417ac2104a62437ef1c52f6c2

Contents?: true

Size: 697 Bytes

Versions: 1

Compression:

Stored size: 697 Bytes

Contents

class Devise::Oauth2Providable::Client < ActiveRecord::Base
  has_many :access_tokens
  has_many :refresh_tokens
  has_many :authorization_codes

  before_validation :init_identifier, :on => :create, :unless => :identifier?
  before_validation :init_secret, :on => :create, :unless => :secret?
  validates :website, :secret, :presence => true
  validates :name, :presence => true, :uniqueness => true
  validates :identifier, :presence => true, :uniqueness => true

  # attr_accessible :name, :website, :redirect_uri

  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

1 entries across 1 versions & 1 rubygems

Version Path
insrc_devise_oauth2_providable-1.1.2 app/models/devise/oauth2_providable/client.rb