Guest User

Untitled

a guest
Jul 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. module Config
  2. # Allows you to scope everything to specific field(s). Works just like validates_uniqueness_of.
  3. # For example, let's say a user belongs to a company, and you want to scope everything to the
  4. # company:
  5. #
  6. # acts_as_authentic do |c|
  7. # c.validations_scope = :company_id
  8. # end
  9. #
  10. # * <tt>Default:</tt> nil
  11. # * <tt>Accepts:</tt> Symbol or Array of symbols
  12. def validations_scope(value = nil)
  13. rw_config(:validations_scope, value)
  14. end
  15. alias_method :validations_scope=, :validations_scope
  16. end
Add Comment
Please, Sign In to add comment