search for: date_sub

Displaying 6 results from an estimated 6 matches for "date_sub".

2011 Aug 16
4
Dashboard table resource_statuses growing uncontrollably
I''ve "inherited" the administration of a puppet-dashboard (version 1.1.0, installed on RHEL 5.6 from puppetlabs RPM), and have hit a problem I''m hoping for some help with. In short, one table, "resource_statuses" appears to be growing at a rate far higher then the other tables: mysql> select count(*) from nodes; +----------+ | count(*) | +----------+ |
2005 Dec 08
2
Confusing lock problem in rails
...t; doc end [count, docs] end def mark_as_viewed(user_id) # user = self.users.find(user_id) end def self.delete_old @p = Pref.find_by_setting(''autodelete'') if @p and @p.value.to_i > 0 val = @p.value.to_i destroy_all(["found_on <= DATE_SUB(CURDATE(), INTERVAL ? DAY)", val]) end end def self.delete_before(params) date = sprintf("%04d-%02d-%02d", params[:foundon][:year], params[:foundon][:month], params[:foundon][:day]) deleted = R...
2006 Jul 25
6
Subtract a field from the current time in MySQL?
I have the following: Table Products: With a column called "purchased_at" of type "datetime". Products.find(:all, :conditions => ["? - purchased_at >= 120", Time.now]) Why doesn''t that work? What I''m trying to do is find records that were purchased less than or equal to 2 minutes ago. Thanks for your help. -- Posted via
2006 Jun 22
4
Filter on variable
Hi all, I have a question about filtering on a variable. If I have the following code in my controller to select a list of users > @allusers = User.find(:all, > :conditions => [''team_id = ?'', @params["id"], > :order => ''created_at'') Is there an easy way to find out all users who
2006 May 04
3
Date find help please.
Here''s my problem. I have an ''Item'' model with a date column called "inserted_on" formatted as "yyyy-mm-dd hh:mm:ss:t". I want to find all records that were inserted more than 30 days ago. How would I say that using the Item.find ( :all .....) method? I don''t fully understand the syntax. I tried @result = Item.find( :all, :conditions =>
2007 Oct 18
3
Automating blacklists
Hi, I've been reading all I can on Google (and Asterisk TFOT book) looking for ideas on how to implement an automated blacklist feature. I would like to automatically blacklist a incoming number based on timestamp and count information. For example, if I get a prank call from the same number 5 times within 15 minutes, I want my dialplan to automatically blacklist this number. Should I be