DEfusion
2007-Dec-12 11:27 UTC
HABTM causes LocalJumpError in Controller : no block given error
I have projects and users which have a many to many relationship, in one of my controllers I am doing the following: @projects = @user.projects.find_all() Whenever there is data in the projects_users I get the following error: LocalJumpError in DashboardController#index no block given e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ base.rb:1529:in `find_all'' e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ associations/association_proxy.rb:124:in `each'' e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ associations/association_proxy.rb:124:in `find_all'' e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ associations/association_proxy.rb:124:in `send'' e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ associations/association_proxy.rb:124:in `method_missing'' e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ associations/association_collection.rb:162:in `method_missing'' app/controllers/dashboard_controller.rb:7:in `index'' -e:2:in `load'' -e:2 I''ve been through the debugger and I can see that the expected data is being picked up active record but I can''t quite see where this error comes from and it''s got me stumped. Any ideas? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2007-Dec-12 11:38 UTC
Re: HABTM causes LocalJumpError in Controller : no block given error
On 12 Dec 2007, at 11:27, DEfusion wrote:> > I have projects and users which have a many to many relationship, in > one of my controllers I am doing the following: > > @projects = @user.projects.find_all() > > Whenever there is data in the projects_users I get the following > error:Does it work if you use the non deprecated call ( find :all) ? Fred> > > LocalJumpError in DashboardController#index > > no block given > > e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ > base.rb:1529:in `find_all'' > e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ > associations/association_proxy.rb:124:in `each'' > e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ > associations/association_proxy.rb:124:in `find_all'' > e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ > associations/association_proxy.rb:124:in `send'' > e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ > associations/association_proxy.rb:124:in `method_missing'' > e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ > associations/association_collection.rb:162:in `method_missing'' > app/controllers/dashboard_controller.rb:7:in `index'' > -e:2:in `load'' > -e:2 > > I''ve been through the debugger and I can see that the expected data is > being picked up active record but I can''t quite see where this error > comes from and it''s got me stumped. > > Any ideas? > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
DEfusion
2007-Dec-12 11:49 UTC
Re: HABTM causes LocalJumpError in Controller : no block given error
It does, thanks for that I was beginning to think I was going mad. Guess I need to swat up on what''s been deprecated. Cheers, -D On Dec 12, 11:38 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 12 Dec 2007, at 11:27, DEfusion wrote: > > > > > I have projects and users which have a many to many relationship, in > > one of my controllers I am doing the following: > > > @projects = @user.projects.find_all() > > > Whenever there is data in the projects_users I get the following > > error: > > Does it work if you use the non deprecated call ( find :all) ? > > Fred > > > > > LocalJumpError in DashboardController#index > > > no block given > > > e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ > > base.rb:1529:in `find_all'' > > e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ > > associations/association_proxy.rb:124:in `each'' > > e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ > > associations/association_proxy.rb:124:in `find_all'' > > e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ > > associations/association_proxy.rb:124:in `send'' > > e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ > > associations/association_proxy.rb:124:in `method_missing'' > > e:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/ > > associations/association_collection.rb:162:in `method_missing'' > > app/controllers/dashboard_controller.rb:7:in `index'' > > -e:2:in `load'' > > -e:2 > > > I''ve been through the debugger and I can see that the expected data is > > being picked up active record but I can''t quite see where this error > > comes from and it''s got me stumped. > > > Any ideas?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---