Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added flags

  • Loading branch information...
commit 859b4a96ad4a015062e47bcdc2b6cbd8460ee753 1 parent f06ff00
@chrismatthieu chrismatthieu authored
View
2  app/controllers/api_controller.rb
@@ -6,7 +6,7 @@ def check
# @reminders = Reminder.where("(appointment > ?) && (appointment < ?) && ( ISNULL(flag1) || ISNULL(flag2) || ISNULL(flag3))", Time.now.utc, Time.now.utc+1.week)
# WORKS IN POSTGRES
- @reminders = Reminder.where("(appointment > ?) && (appointment < ?) && ( flag1 = 0 || flag2 = 0 || flag3 = 0)", Time.now.utc.strftime('%Y-%m-%dT%H:%M:%SZ'), (Time.now.utc+1.week).strftime('%Y-%m-%dT%H:%M:%SZ') )
+ @reminders = Reminder.where("(appointment > ?) and (appointment < ?) and ( flag1 = 0 or flag2 = 0 or flag3 = 0)", Time.now.utc, Time.now.utc+1.week )
@reminders.each do |reminder|
View
13 db/migrate/20110226001423_add_flags_to_reminders.rb
@@ -0,0 +1,13 @@
+class AddFlagsToReminders < ActiveRecord::Migration
+ def self.up
+ add_column :reminders, :flag1, :boolean
+ add_column :reminders, :flag2, :boolean
+ add_column :reminders, :flag3, :boolean
+ end
+
+ def self.down
+ remove_column :reminders, :flag3
+ remove_column :reminders, :flag2
+ remove_column :reminders, :flag1
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.