Sha256: 5b64b2a61577a0063a20db1d98ddbb5df8647cfc21cbe7aaae4cca8b1804d2a5

Contents?: true

Size: 414 Bytes

Versions: 8

Compression:

Stored size: 414 Bytes

Contents

class Client < ActiveRecord::Base
  has_many :access_tokens
  has_many :refresh_tokens

  before_validation :setup, :on => :create
  validates :name, :website, :redirect_uri, :secret, :presence => true
  validates :identifier, :presence => true, :uniqueness => true

  private

  def setup
    self.identifier = ActiveSupport::SecureRandom.base64(16)
    self.secret = ActiveSupport::SecureRandom.base64
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
devise_oauth2_providable-0.1.6 app/models/client.rb
devise_oauth2_providable-0.1.5 app/models/client.rb
devise_oauth2_providable-0.1.4 app/models/client.rb
devise_oauth2_providable-0.1.3 app/models/client.rb
devise_oauth2_providable-0.1.2 app/models/client.rb
devise_oauth2_providable-0.1.1 app/models/client.rb
devise_oauth2_providable-0.1.0 app/models/client.rb
devise_oauth2_token_bearer_authenticatable-0.0.1 app/models/client.rb