Association couldn't be found, Rails 4.1.8
Closed this issue · 3 comments
I have a very simple two model scenario with a has_many association in the model that I want to clone. So I declared
class PostsCloner < Clowne::Cloner
adapter :active_record
include_association :comments
end
The clone attempt results in an exception: Clowne::Adapters::ActiveRecord::Resolvers::UnknownAssociation: Association comments couldn't be found for User
It appears that this code is attempting to resolve the relation using a string index into ...reflections, but the reflections hash uses symbols.
clowne/lib/clowne/adapters/active_record/resolvers/association.rb
Lines 12 to 18 in 3d8f23f
Maybe this is a compatibility issue with Rails 4.1.8, Ruby 2.3
Closed because of #41 (comment)
Having the same issue on Rails 5.2.4.5 -- will dig further to see if I can improve the PR.