diff --git a/Gemfile b/Gemfile index 09b42f4..ebfa1bd 100644 --- a/Gemfile +++ b/Gemfile @@ -14,6 +14,8 @@ gem 'devise-kerberos-authenticatable', :git => 'git://github.com/atomaka/devise-kerberos-authenticatable.git' gem 'cancan' +gem 'enumerated_attribute' + # Gems used only for assets and not required # in production environments by default. diff --git a/Gemfile.lock b/Gemfile.lock index 69a4962..7cfda63 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -72,6 +72,8 @@ GEM orm_adapter (~> 0.1) railties (~> 3.1) warden (~> 1.2.1) + enumerated_attribute (0.2.16) + meta_programming (>= 0.2.1) erubis (2.7.0) eventmachine (1.0.3) execjs (1.4.0) @@ -97,6 +99,7 @@ GEM i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) + meta_programming (0.2.2) meta_request (0.2.3) rack-contrib railties @@ -191,6 +194,7 @@ DEPENDENCIES coffee-rails (~> 3.2.1) devise devise-kerberos-authenticatable! + enumerated_attribute jquery-rails less-rails meta_request diff --git a/app/models/alert.rb b/app/models/alert.rb index 75d7b80..7a56f50 100644 --- a/app/models/alert.rb +++ b/app/models/alert.rb @@ -1,4 +1,5 @@ class Alert < ActiveRecord::Base + enum_attr :semester, %w(US13 FS13 SS14) attr_accessible :course, :department, :semester, :sections attr_protected :user_id attr_protected :alerted diff --git a/app/views/alerts/_form.html.erb b/app/views/alerts/_form.html.erb index 61392ec..d6ba143 100644 --- a/app/views/alerts/_form.html.erb +++ b/app/views/alerts/_form.html.erb @@ -35,7 +35,7 @@