resolve/refinerycms — Issue #1291: undefined method `where'
Author: alocay
Created: 2012-02-09 07:08:37+00:00
State: open

I'm new to Refinery CMS so I apologize if this has already been solved but I couldn't find anything in the Issues area via searching.

I have seen this issue 3 times, the first two times I thought may have been my fault, but I wasn't sure what was wrong on the 3rd instance. What I do is just create 2 engines and the 2nd one gives me this error when I click on its tab in the Refinery section of my site.

The first engine is just:

rails g refinery_engine MenuCategory category:string

This one works fine.

The second one is generated via:

rails g refinery_engine MenuItem name:string description:string price:decimal menu_category_id:integer

It is generated and migrated fine but when I load the site and click on its new tab it throws this exception:

undefined method `where' for Refinery::MenuItem:Class

The top of the trace showing:

(eval):106:in `find_all_menu_items'
(eval):114:in `paginate_all_menu_items'
(eval):4:in `index'
actionpack (3.0.11) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.0.11) lib/abstract_controller/base.rb:150:in `process_action'
actionpack (3.0.11) lib/action_controller/metal/rendering.rb:11:in `process_action'
actionpack (3.0.11) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.0.11) lib/active_support/callbacks.rb:471:in `_run__891786675933579336__process_action__1651167218366637553__callbacks'