Association named 'variations' was not found; perhaps you misspelled it?
I just was hunting down a strange error with this model:
class Model
placeholder = 'variations'
has_many placeholder
nested_scope :verbose, :include => :variations
end
Everything, including Model.variations
and Model.reflect_on_all_associations.map &:name
did work (the latter returned [ :some_association, 'variations' ]
).
Eventually, the quotes led me to the solution: I had to write has_many placeholder.to_sym
.
When Rails can't find an association, make sure it's defined as symbol
Seemingly, that's a bug in Rails.
Posted by Dominik Schöler to makandra dev (2011-12-20 10:38)