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.

Wrong finder behaviour

#14

These similar queries result to different SQL find statement - altough they should be the same thing.
The latter one does not use translations at all.

Tracker.find_by_title('tracker')

=> SELECT "sections".* FROM "sections" INNER JOIN "section_translations" ON section_translations.section_id = sections.id WHERE (section_translations.title = 'tracker' AND section_translations.locale IN ('en','root')) AND ( ("sections"."type" = 'Tracker' ) ) ORDER BY lft LIMIT 1

Tracker.find(:first, :conditions => {:title => 'tracker'})

=> SELECT * FROM "sections" WHERE ("sections"."title" = 'tracker') AND ( ("sections"."type" = 'Tracker' ) ) ORDER BY lft LIMIT 1

Reported by Marko Seppä · August 13th, 2009 @ 03:04 PM

State: invalid
Milestone: none
Assigned to: Josh H Josh H

Activity

  1. Josh H
    Josh H
    • Assigned user set to Josh H
    • State changed from new to invalid

    This isn't exactly a bug. The find_by_* feature was added as a special advanced feature to support limited translation finding. Expanding this to the general case would be very complicated and is probably not worth doing at this point.

    August 17th, 2009 @ 01:01 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.