O Rails 4 introduziu um aviso de depreciação ao usar: uniq => true com has_many: through. Por exemplo:
has_many :donors, :through => :donations, :uniq => true
Rende o seguinte aviso:
DEPRECATION WARNING: The following options in your Goal.has_many :donors declaration are deprecated: :uniq. Please use a scope block instead. For example, the following:
has_many :spam_comments, conditions: { spam: true }, class_name: 'Comment'
should be rewritten as the following:
has_many :spam_comments, -> { where spam: true }, class_name: 'Comment'
Qual é a maneira correta de reescrever a declaração has_many acima?