Created
January 8, 2011 20:15
-
-
Save oelmekki/771117 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment