From 8c05bfd52336b2ecef0788d1cfbd29f68fa34e56 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Thu, 11 Apr 2013 21:38:41 -0400 Subject: [PATCH] Setup sections in model --- app/models/alert.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/alert.rb b/app/models/alert.rb index eed0b1c..aff04bf 100644 --- a/app/models/alert.rb +++ b/app/models/alert.rb @@ -24,6 +24,9 @@ class Alert < ActiveRecord::Base # only_integer: true # } validates :semester, :presence => true + validates :sections, :presence => true + + serialize :sections scope :user_alerts, lambda { |user_id| where('Alerts.user_id = ?', user_id)