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.

conditions_tables matches date ranges

#1393

ActiveRecord::Associations::ClassMethods#conditions_tables matches ranges in conditions. When you have a range in your conditions, say for example of 1.month.ago..Time.now, it returns [.].

Example:


>> User.first.logins.conditions_tables(:conditions => {:created_at => 1.month.ago...Time.now})
=> ["logins", "UTC.."]

This regexp is to blame:


conditions.join(' ').scan(/([\.a-zA-Z_]+).?\./).flatten

I'm working on a patch.

Reported by Jan De Poorter · November 17th, 2008 @ 06:01 PM

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

Activity

  1. Jan De Poorter
    Jan De Poorter

    A failing test. I can't seem to figure out what the correct regexp should be.

    November 18th, 2008 @ 10:58 AM

  2. Frederick Cheung