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 of has-many association does not respect :finder_sql

#412

class Firm < Company
     has_many :clients_using_finder_sql, :class_name => "Client", :finder_sql => 'SELECT * FROM companies WHERE 1=1'
     has_many :empty_clients_using_finder_sql, :class_name => "Client", :finder_sql => 'SELECT * FROM companies WHERE 1=0'
end

def test_preloading_when_using_finder_sql
    firm = Firm.find(:first,:include => :empty_clients_using_finder_sql)
    assert_equal(0,firm.empty_clients_using_finder_sql.size)
end

a patch against rails git is attached

Reported by darren_hoo · June 13th, 2008 @ 08:08 PM

State: stale
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. josh
    josh
    • State changed from new to stale
    • Tag set to activerecord, dependencies, eager_loading, edge, tested

    September 18th, 2008 @ 03:48 PM