Closed tjsingleton closed 9 years ago
first_or_create
method silently deprecated and has some bad side effects.
Using find_or_create_by
instead is fixing this issue.
See also https://github.com/rails/rails/commit/0096f53b25e68c3fc79429253f816fff4a4ee596.
@dimko Thanks!
Given a model like
And I'm in a fresh rails console When I call first_or_create
Then I get an error
This seems to because ActiveRecord has not defined the attribute methods. The odd thing is from reading the ActiveRecord source, it seems like define_attribute_methods should be invoked.
My current workaround is