#6 ✓resolved
Georg Ledermann

Some date modifiers producing wrong conditions

Reported by Georg Ledermann | October 3rd, 2008 @ 04:24 PM

This works fine:

Contact.all(:conditions => {:week_of_created_at_less_than => 40})
=> SELECT * FROM `contacts` WHERE (WEEK(`contacts`.`created_at`, 2) < 40)

But the following modifiers are generating wrong statements:

 Contact.all(:conditions => {:week_of_created_at => 10})
 OR
 Contact.all(:conditions => {:week_of_created_at_equals => 10})
  =>  SELECT * FROM `contacts` WHERE (`contacts`.`created_at` = 10)
 (WEEK missing)

 Contact.all(:conditions => {:year_of_created_at_gt => 10})
 => SELECT * FROM `contacts` WHERE (MONTH(`contacts`.`created_at`) > 10)
 (MONTH is used instead of YEAR)

It seems to me that the method "def modifier_names" is missing in some classes of Searchgasm::Modifiers. Perhaps you should check the other classes in the module.

Comments and changes to this ticket

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Provides common named scopes and object based searching.

People watching this ticket

Pages