Module: Authlogic::ActsAsAuthentic::ValidationsScope::Config

Defined in:
lib/authlogic/acts_as_authentic/validations_scope.rb

Overview

All configuration for the scope feature.

Instance Method Summary collapse

Instance Method Details

#validations_scope(value = nil) ⇒ Object Also known as: validations_scope=

Allows you to scope everything to specific field(s). Works just like validates_uniqueness_of. For example, let’s say a user belongs to a company, and you want to scope everything to the company:

acts_as_authentic do |c|
  c.validations_scope = :company_id
end
  • Default: nil

  • Accepts: Symbol or Array of symbols



25
26
27
# File 'lib/authlogic/acts_as_authentic/validations_scope.rb', line 25

def validations_scope(value = nil)
  rw_config(:validations_scope, value)
end