Closed lucthev closed 4 years ago
Thanks for the PR @lucthev .
The change looks good to me @kratob . I was hesistant over the change unless options[:foreign_key] || options[:as]
, but I guess that the :as
option implies :foreign_key
, since we're using the foreign key from the polymorphic interface.
I think this looks good. I've released the change as version 1.3.1.
When using
change_assocation
with a polymorphic association, active type is overwriting the association'sforeign_key
, causing "unknown column" errors.Fix this by skipping the foreign key override when using a polymorphic association (
as: ...
).