class Person
validates :full_name, presence: true
validates :display_name, unique: ???
attr_acessible :full_name, :display_name
end
Full names can not be unique, but the display name must be unique. If I want to have the full_name as a fallback, but I still want to check for uniqueness of the display_name.
What is the cleanest way to validate the uniqueness of coalesce(display_name, full_name)
or whatever is necessary to achieve the same effect?