Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a discharged flag to users.

  • Loading branch information...
commit f535a7e76a5c607d74d2189973011695e9c3ca2d 1 parent 6034be5
@adambaker authored
View
9 db/migrate/20120211211230_add_discharged_to_users.rb
@@ -0,0 +1,9 @@
+class AddDischargedToUsers < ActiveRecord::Migration
+ def self.up
+ add_column :users, :discharged, :boolean, default: false
+ end
+
+ def self.down
+ remove_column :users, :discharged
+ end
+end
View
3  db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20111209085641) do
+ActiveRecord::Schema.define(:version => 20120211211230) do
create_table "dishonorable_discharges", :force => true do |t|
t.string "email"
@@ -93,6 +93,7 @@
t.boolean "attend_rsvp", :default => false
t.boolean "maybe_rsvp", :default => false
t.boolean "new_event", :default => false
+ t.boolean "discharged", :default => false
end
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
View
9 spec/models/user_spec.rb
@@ -112,6 +112,7 @@
DishonorableDischarge.create!(@attr.merge(officer: officer.id, reason: 'something'))
User.new(@attr).should_not be_valid
end
+
describe "event attendance" do
before :each do
@@ -329,10 +330,10 @@
describe "defaults" do
{
- attend_reminder: true, maybe_reminder: false, host_reminder: false,
- track_host: true, track_attend: true, track_maybe: false,
- host_rsvp: true, attend_rsvp: false, maybe_rsvp: false,
- new_event: false, rank: 1
+ attend_reminder?: true, maybe_reminder?: false, host_reminder?: false,
+ track_host?: true, track_attend?: true, track_maybe?: false,
+ host_rsvp?: true, attend_rsvp?: false, maybe_rsvp?: false,
+ new_event?: false, rank: 1, discharged?: false,
}.each do |name, value|
it "should have #{name.to_s} default to #{value.to_s}." do
User.create(@attr).send(name).should == value
Please sign in to comment.
Something went wrong with that request. Please try again.