Ruby on Rails Monday, January 14, 2019

I don't follow. The column name isn't OldClassName, so I'm not sure what that assignment is supposed to mean.

The issue is that a polymorphic reference can literally be any activerecord model in your app, there's no restrictions. Really the only reliable way is to look at the DB and group by `polymorphable_type` to see which models you've referenced. You can't know by looking at the code alone (unless you count looking at the code history too).

On Monday, January 14, 2019 at 1:48:29 AM UTC-8, Greg Navis wrote:
Wouldn't the problem be solved by either 1. running a migration changing OldClassName to NewClassName, 2. doing `OldClassName = NewClassName` in `app/models/old_class_name.rb`?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/93c019f6-f61d-4aaf-9bf7-d61d32e1fdda%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment