Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Config
- # 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
- #
- # * <tt>Default:</tt> nil
- # * <tt>Accepts:</tt> Symbol or Array of symbols
- def validations_scope(value = nil)
- rw_config(:validations_scope, value)
- end
- alias_method :validations_scope=, :validations_scope
- end
Add Comment
Please, Sign In to add comment