-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getting const_defined? error when belongs_to :event is used #15
Comments
here is some debugger output: |
@krglobal Did you solve this issue? This happened to me too after I upgraded from rails 3.x to 4.x |
No i did not really solve it but worked around it. by excluding my index If you know how to fix root cause I'd love to hear how. On Tuesday, April 19, 2016, Dennis Günnewig [email protected]
Best Regards, |
now I got another one on an index method that was not even included in the list of make_resourceful methods after making some random code changes that seemingly had nothing to do with it. stay away from belongs_to in your make resourceful usage! |
Thanks for the hint. We started to get rid of the whole gem. |
I am upgrading from Rails 2.3 to Rails 3.2 and have many controllers using make_resourceful.
I have a very simple model called TemplateType which I use in my mailings controller.
When I try to get any row from it in my new method, I get:
undefined method `const_defined?' for "event":String
it is failing when trying to run through the controllers parents for some reason... see below.
if I remove the belongs_to :event statement and put in my own code to get the parent event, (my controller is mailings which have an event parent) then the problem clears up. what is make_resourceful trying to do here and how can I get it to not fail? what is different from Rails 2.3 version I wonder.
undefined method `const_defined?' for "event":String
Rails.root: /Users/kurtrobson/rails/ml_32
Application Trace | Framework Trace | Full Trace
activesupport (3.2.18) lib/active_support/dependencies.rb:390:in
local_const_defined?' activesupport (3.2.18) lib/active_support/dependencies.rb:508:in
block in load_missing_constant'activesupport (3.2.18) lib/active_support/dependencies.rb:508:in
each' activesupport (3.2.18) lib/active_support/dependencies.rb:508:in
any?'activesupport (3.2.18) lib/active_support/dependencies.rb:508:in
load_missing_constant' activesupport (3.2.18) lib/active_support/dependencies.rb:192:in
block in const_missing'activesupport (3.2.18) lib/active_support/dependencies.rb:190:in
each' activesupport (3.2.18) lib/active_support/dependencies.rb:190:in
const_missing'app/controllers/mailings_controller.rb:51:in
block (2 levels) in <class:MailingsController>' make_resourceful (1.0.2) lib/resourceful/default/callbacks.rb:39:in
instance_eval'make_resourceful (1.0.2) lib/resourceful/default/callbacks.rb:39:in
block in scope' make_resourceful (1.0.2) lib/resourceful/default/callbacks.rb:47:in
call'make_resourceful (1.0.2) lib/resourceful/default/callbacks.rb:47:in
block in resourceful_fire' make_resourceful (1.0.2) lib/resourceful/default/callbacks.rb:47:in
each'make_resourceful (1.0.2) lib/resourceful/default/callbacks.rb:47:in
resourceful_fire' make_resourceful (1.0.2) lib/resourceful/default/callbacks.rb:12:in
before'make_resourceful (1.0.2) lib/resourceful/default/actions.rb:76:in
new' actionpack (3.2.18) lib/action_controller/metal/implicit_render.rb:4:in
send_action'actionpack (3.2.18) lib/abstract_controller/base.rb:167:in
process_action' actionpack (3.2.18) lib/action_controller/metal/rendering.rb:10:in
process_action'actionpack (3.2.18) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
The text was updated successfully, but these errors were encountered: