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:ineach’
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:insend’
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:inmethod_missing’
app/controllers/dashboard_controller.rb:7:in index' -e:2:inload’
-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?

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

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 C. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs