diff --git a/app/models/alert.rb b/app/models/alert.rb index aff04bf..e88edd4 100644 --- a/app/models/alert.rb +++ b/app/models/alert.rb @@ -1,5 +1,5 @@ class Alert < ActiveRecord::Base - attr_accessible :course, :department, :semester + attr_accessible :course, :department, :semester, :sections attr_protected :user_id attr_protected :alerted @@ -19,14 +19,9 @@ class Alert < ActiveRecord::Base :format => { :with => /\A[0-9]+[A-Za-z]?\Z/ } - # validates :user_id, :presence => true, - # :numericality => { - # only_integer: true - # } validates :semester, :presence => true - validates :sections, :presence => true - serialize :sections + serialize :sections, Array scope :user_alerts, lambda { |user_id| where('Alerts.user_id = ?', user_id) @@ -39,8 +34,4 @@ class Alert < ActiveRecord::Base def course_name "#{self.department} #{self.course}" end - - def sections - - end end