Sha256: 087bd1efe86397eae994eeae66316d40f359a03267e58a03d164fbafcd1ab16f

Contents?: true

Size: 1.1 KB

Versions: 5

Compression:

Stored size: 1.1 KB

Contents

require 'active_support'

# :nodoc: namespace
module Authpwn

# Included by the model class that represents facebook tokens.
#
# Parts of the codebase assume the model will be named Credential.
module CredentialModel
  extend ActiveSupport::Concern

  included do
    # The user whose token this is.
    belongs_to :user, :inverse_of => :credentials
    validates :user, :presence => true
    
    # Name that can be used to find the token.
    validates :name, :length => { :in => 1..128, :allow_nil => true },
                     :uniqueness => { :scope => [:type], :allow_nil => true }
  
    # Secret information associated with the token.
    validates :key, :length => { :in => 1..2.kilobytes, :allow_nil => true }
  end

  # Included in the metaclass of models that call pwnauth_facebook_token_model.
  module ClassMethods
    
  end  # module Authpwn::FacebookTokenModel::ClassMethods

  
  # Included in models that include Authpwn::FacebookTokenModel.
  module InstanceMethods
    
  end  # module Authpwn::FacebookTokenModel::InstanceMethods
  
end  # namespace Authpwn::FacebookTokenModel

end  # namespace Authpwn

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
authpwn_rails-0.10.4 lib/authpwn_rails/credential_model.rb
authpwn_rails-0.10.3 lib/authpwn_rails/credential_model.rb
authpwn_rails-0.10.2 lib/authpwn_rails/credential_model.rb
authpwn_rails-0.10.1 lib/authpwn_rails/credential_model.rb
authpwn_rails-0.10.0 lib/authpwn_rails/credential_model.rb