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.

ActiveRecord::Base refactoring

#863

While checking out the terrain for another bigger fix, I stumbled across a little inconsistency in AR::Base.

In the SQL builder methods, add_joins!, add_limit! and add_lock! currently take the full options hash whereas their siblings, add_conditions!, add_order! and add_group! take only their relevant attribute. While I see why add_limit! needs to do that (it may take both, :limit and :offset), add_lock! and add_joins! only use their respective options and no other one.

I therefore propose the attached patch to always (and therefore consistently) pass in the full options hash. Although it's only an internally used, private method I think that consistency is still important.

All existing tests pass (apart from the two tests that seem to be failing anyways in the current Edge).

Reported by Clemens Kofler · August 19th, 2008 @ 11:30 PM

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

Activity

  1. Pratik
    Pratik
    • State changed from new to wontfix

    Don't really see any benefits of this. Maybe this could be done whenever those methods need to access other option values.

    August 20th, 2008 @ 12:48 AM