-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
Scope doesn't seem to work with aliased field names. For example,
class Address # municipality, postal_code and country symbols are field aliases validates :street_line_1, :uniqueness => { :scope => [:municipality,:postal_code,:country] } end
Will result in duplicates.
Changing the aliased scope fields to their proper names fixes the issue.
class Address # it's all good now validates :street_line_1, :uniqueness => { :scope => [:a,:b,:c] } end