I have created a rails app.
When in development mode, I hit a problem the second time I try to
display a page from a particular controller: it raises a method_missing
exception because suddenly the model I am trying to use has forgotten
about all the methods I added to it, and all its association methods
(from has_one and has_many). Inspecting the model shows that it still
has it’s @attributes array.
In production mode, it works fine. Same result on Rails 1.x and 2.0.2.
Below is an example exception. In my DB, System has_many
test_results.
Any ideas?
Thanks,
-Sam.
undefined method `test_results’ for #System:0x2521eb0
RAILS_ROOT:
/Users/sam/Development/ideas/trunk/spierson/pbits/server/pbits2
Application Trace | Framework Trace | Full Trace
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:205:in
method_missing' app/controllers/results_controller.rb:34:in
report’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/association_proxy.rb:125:in
each' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/association_proxy.rb:125:in
send’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/association_proxy.rb:125:in
method_missing' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/has_many_through_association.rb:133:in
method_missing_without_paginate’
vendor/plugins/will_paginate/lib/will_paginate/finder.rb:93:in
method_missing' app/controllers/results_controller.rb:32:in
report’
/Library/Ruby/Gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in
`send’
<snip - boring part deleted>