My custom message for scoped uniqueness validation is not displayed.
I'm including what I think is the relevant code, but please let me know if you think there's something else that you might need to see.
class Beverage < ActiveRecord::Base
has_many :grapeages, dependent: :destroy
has_many :wine_varietals, through: :grapeages
validates_associated :grapeages
end
class Grapeage < ActiveRecord::Base
belongs_to :beverage
belongs_to :wine_varietal
# Neither of these seem to work:
#validates :wine_varietal_id, uniqueness: {scope: :beverage_id, message: 'xxx'}
validates_uniqueness_of :wine_varietal_id, scope: :beverage_id, message: 'xxx'
end
Rather than 'xxx', the displayed error message is:
Grapeages is invalid