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'
gem 'cancan'
gem 'enumerated_attribute'
# Gems used only for assets and not required
# in production environments by default.

View file

@ -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

View file

@ -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

View file

@ -35,7 +35,7 @@
<div class="control-group">
<%= f.label :semester, :class => 'control-label' %>
<div class="controls">
<%= f.text_field :semester, :class => 'text_field' %>
<%= f.enum_select :semester %>
</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.
ActiveRecord::Schema.define(:version => 20130413054153) do
ActiveRecord::Schema.define(:version => 20130424230817) do
create_table "alerts", :force => true do |t|
t.integer "user_id"
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
# Could not dump table "alerts" because of following StandardError
# Unknown type 'enum' for column 'semester'
create_table "roles", :force => true do |t|
t.string "name"