Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

eager loading fails with ArgumentError

#921

hi, a simple eager loading like


@account = Account.find(params[:id], :include => :group) # belongs_to

results in


vendor/rails/activerecord/lib/active_record/association_preload.rb:13:in `respond_to?'
vendor/rails/activerecord/lib/active_record/association_preload.rb:13:in `flatten'
vendor/rails/activerecord/lib/active_record/association_preload.rb:13:in `preload_associations'
vendor/rails/activerecord/lib/active_record/base.rb:1424:in `find_every'
vendor/rails/activerecord/lib/active_record/base.rb:1457:in `find_one'
vendor/rails/activerecord/lib/active_record/base.rb:1443:in `find_from_ids'
vendor/rails/activerecord/lib/active_record/base.rb:570:in `find'
app/controllers/administration/accounts_controller.rb:36:in `show'

on edge rails.

Reported by Claudio Poli · August 28th, 2008 @ 04:13 AM

State: invalid
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Claudio Poli
    Claudio Poli
    • Title changed from eager loading fails to eager loading fails with ArgumentError

    whops, forgot the important exception

    
    ArgumentError in Administration/accountsController#show
    
    wrong number of arguments (2 for 1)
    

    backtrace is in ticket post.

    August 28th, 2008 @ 04:15 AM

  2. Claudio Poli
    Claudio Poli

    I'm using ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-darwin9.3.0]. I've read some other ticket about similar issues on specific ruby versions, so here goes.

    August 28th, 2008 @ 04:32 AM

  3. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to invalid

    This works for me. Please include a failing test case.

    August 28th, 2008 @ 05:16 AM

  4. Claudio Poli
    Claudio Poli

    after a bit of research I just found out that a collegue did a respond_to? override in a model, without specifying the arguments parameter and without tests.

    sorry for the noise.

    August 28th, 2008 @ 05:24 AM

  5. Jeremy Kemper