1
0
Fork 0

Merge branch 'feature-semester_select'

This commit is contained in:
Andrew Tomaka 2013-04-24 19:15:14 -04:00
commit 5d7259b49d
6 changed files with 24 additions and 12 deletions

View file

@ -14,6 +14,8 @@ gem 'devise-kerberos-authenticatable',
:git => 'git://github.com/atomaka/devise-kerberos-authenticatable.git' :git => 'git://github.com/atomaka/devise-kerberos-authenticatable.git'
gem 'cancan' gem 'cancan'
gem 'enumerated_attribute'
# Gems used only for assets and not required # Gems used only for assets and not required
# in production environments by default. # in production environments by default.

View file

@ -72,6 +72,8 @@ GEM
orm_adapter (~> 0.1) orm_adapter (~> 0.1)
railties (~> 3.1) railties (~> 3.1)
warden (~> 1.2.1) warden (~> 1.2.1)
enumerated_attribute (0.2.16)
meta_programming (>= 0.2.1)
erubis (2.7.0) erubis (2.7.0)
eventmachine (1.0.3) eventmachine (1.0.3)
execjs (1.4.0) execjs (1.4.0)
@ -97,6 +99,7 @@ GEM
i18n (>= 0.4.0) i18n (>= 0.4.0)
mime-types (~> 1.16) mime-types (~> 1.16)
treetop (~> 1.4.8) treetop (~> 1.4.8)
meta_programming (0.2.2)
meta_request (0.2.3) meta_request (0.2.3)
rack-contrib rack-contrib
railties railties
@ -191,6 +194,7 @@ DEPENDENCIES
coffee-rails (~> 3.2.1) coffee-rails (~> 3.2.1)
devise devise
devise-kerberos-authenticatable! devise-kerberos-authenticatable!
enumerated_attribute
jquery-rails jquery-rails
less-rails less-rails
meta_request meta_request

View file

@ -1,4 +1,5 @@
class Alert < ActiveRecord::Base class Alert < ActiveRecord::Base
enum_attr :semester, %w(US13 FS13 SS14)
attr_accessible :course, :department, :semester, :sections attr_accessible :course, :department, :semester, :sections
attr_protected :user_id attr_protected :user_id
attr_protected :alerted attr_protected :alerted

View file

@ -35,7 +35,7 @@
<div class="control-group"> <div class="control-group">
<%= f.label :semester, :class => 'control-label' %> <%= f.label :semester, :class => 'control-label' %>
<div class="controls"> <div class="controls">
<%= f.text_field :semester, :class => 'text_field' %> <%= f.enum_select :semester %>
</div> </div>
</div> </div>

View file

@ -0,0 +1,13 @@
class ChangeAlertsSemesterType < ActiveRecord::Migration
def up
change_table :alerts do |t|
t.change :semester, :enum
end
end
def down
change_table :alerts do |t|
t.change :semester, :string
end
end
end

View file

@ -11,18 +11,10 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20130413054153) do ActiveRecord::Schema.define(:version => 20130424230817) do
create_table "alerts", :force => true do |t| # Could not dump table "alerts" because of following StandardError
t.integer "user_id" # Unknown type 'enum' for column 'semester'
t.string "department"
t.string "course"
t.boolean "alerted", :default => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "semester"
t.text "sections"
end
create_table "roles", :force => true do |t| create_table "roles", :force => true do |t|
t.string "name" t.string "name"