Permalink
Browse files

added flags

  • Loading branch information...
1 parent f06ff00 commit 859b4a96ad4a015062e47bcdc2b6cbd8460ee753 @chrismatthieu chrismatthieu committed Feb 26, 2011
Showing with 14 additions and 1 deletion.
  1. +1 −1 app/controllers/api_controller.rb
  2. +13 −0 db/migrate/20110226001423_add_flags_to_reminders.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|
@@ -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

0 comments on commit 859b4a9

Please sign in to comment.