rails: Method find and attribute are missing, but the columns exists.

Hello. I have a very strange problem with find_by_column_name in my application of wich the column name exists in my database, and this action sometimes works perfectly, and sometimes returns this error. Totally random! Follows the two errors I’m having

  • NoMethodError: undefined method `find_by_name’ for #Class:0x00000006dc7250’

And to other model, and other action:

  • ActiveModel::MissingAttributeError: missing attribute: name_pt

In both cases the migrations were performed, and the columns exists in database, and the most intriguing is that when I acess the console in production mode, and call find_by_name to my object, this works perfectly. I’m using Rails 3.0.9, Unicorn 3.6.2 and Ruby 1.9.2

Thanks for listening!

About this issue

  • Original URL
  • State: closed
  • Created 13 years ago
  • Comments: 27 (19 by maintainers)

Most upvoted comments

Same issue with Rails 5, but only in certain validations. Super weird

We’re seeing this issue as well, running inside Resque. Very random, very odd. Can’t reliably reproduce it.