From: <jh...@us...> - 2009-12-10 22:26:39
|
Revision: 181 http://etch.svn.sourceforge.net/etch/?rev=181&view=rev Author: jheiss Date: 2009-12-10 22:26:28 +0000 (Thu, 10 Dec 2009) Log Message: ----------- Add updated_since and not_updated_since parameters to allow searching for clients last updated before or after a given point. Previously searching against the updated_at field was limited to searching for hosts last updated at an exact time, which doesn't seem very useful. Modified Paths: -------------- trunk/server/app/controllers/clients_controller.rb Modified: trunk/server/app/controllers/clients_controller.rb =================================================================== --- trunk/server/app/controllers/clients_controller.rb 2009-12-10 21:10:38 UTC (rev 180) +++ trunk/server/app/controllers/clients_controller.rb 2009-12-10 22:26:28 UTC (rev 181) @@ -47,6 +47,12 @@ elsif key == 'name_substring' conditions_query << "name LIKE ?" conditions_values << '%' + value + '%' + elsif key == 'updated_since' + conditions_query << "updated_at >= ?" + conditions_values << value.to_i.hours.ago + elsif key == 'not_updated_since' + conditions_query << "updated_at < ?" + conditions_values << value.to_i.hours.ago elsif allowed_queries.include?(key) conditions_query << "#{key} = ?" conditions_values << value This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |