I use the following code to help find sales for the current month. My development db is SQLite, but I'm using Heroku for production, which uses PostgreSQL. So I am getting an strftime function doesn't exist error. How would I translate this, and is there a way to translate it so that it still works when querying my dev SQLite db as well?
sales = current_user.location.sales.find( :all,
:conditions => ["strftime('%Y', date) = '?'
AND strftime('%m', date) = ?",
Date.today.year,
Date.today.strftime('%m')],
:order => "date")