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.

Dynamic finders should go through AR::Base::find

#1162

This is so when people override ActiveRecord::Base::find, the new ::find method will also be invoked by the dynamic finders.

Associations, for instance, do go through ::find, so this makes it more consistent.

Reported by Eloy Duran · October 3rd, 2008 @ 09:12 AM

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

Activity

  1. Pascal Ehlert
    Pascal Ehlert

    +1 for that.. Highly appreciated from my side as I had the same problem when writing a plugin and never understood why we were using those methods anyway.

    October 3rd, 2008 @ 11:21 AM

  2. Eloy Duran
    Eloy Duran

    I attached a newer version which also removes the unnecessary deprecation silence blocks.

    October 3rd, 2008 @ 12:58 PM

  3. Repository
    Repository
    • State changed from new to committed

    (from [8d337e9ec2e25007d557150dbe7557ab3c3bd05f]) Dynamic finders should use the ActiveRecord::Base::find method instead of ::find_initial, :find_last, and ::find_all.

    This is so when people override ActiveRecord::Base::find, the new ::find method will also be invoked by the dynamic finders. Associations for instance do go through ::find, so this makes it more consistent. Also removed the unnecessary deprecation silence blocks.

    Signed-off-by: Michael Koziarski michael@koziarski.com

    [#1162 Dynamic finders should go through AR::Base::find state:committed] http://github.com/rails/rails/co...

    October 3rd, 2008 @ 08:44 PM