Rails 4 ha introducido una advertencia de obsolescencia al usar: uniq => true con has_many: through. Por ejemplo:
has_many :donors, :through => :donations, :uniq => true
Produce la siguiente advertencia:
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'
¿Cuál es la forma correcta de reescribir la declaración has_many anterior?