
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
-
Ben Johnson October 3rd, 2008 @ 04:30 PM
Thanks for letting me know about this, good finds. Update from the repo, this should all be fixed. Let me know if you find anything else.
-
-
Ben Johnson October 3rd, 2008 @ 04:47 PM
- State changed from new to resolved
Cool, let me know if you find anything else
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.
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.