Skip to content

Commit 7896ffe

Browse files
committed
Added default status for users. Closes #113
1 parent 1009b71 commit 7896ffe

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class AddStatusAsDefaultForUsers < ActiveRecord::Migration
2+
def up
3+
change_column :users, :status, :string, :default => "active"
4+
end
5+
6+
def down
7+
change_column :users, :status, :string, :default => nil
8+
end
9+
end

db/schema.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212
# It's strongly recommended to check this file into your version control system.
1313

14-
ActiveRecord::Schema.define(:version => 20130221173650) do
14+
ActiveRecord::Schema.define(:version => 20130224150724) do
1515

1616
create_table "activities", :force => true do |t|
1717
t.text "content"
@@ -57,8 +57,8 @@
5757
end
5858

5959
create_table "users", :force => true do |t|
60-
t.string "email", :default => "", :null => false
61-
t.string "encrypted_password", :limit => 128, :default => "", :null => false
60+
t.string "email", :default => "", :null => false
61+
t.string "encrypted_password", :limit => 128, :default => "", :null => false
6262
t.string "reset_password_token"
6363
t.datetime "reset_password_sent_at"
6464
t.datetime "remember_created_at"
@@ -72,13 +72,13 @@
7272
t.text "last_name"
7373
t.text "ido_id"
7474
t.string "locale"
75-
t.datetime "created_at", :null => false
76-
t.datetime "updated_at", :null => false
75+
t.datetime "created_at", :null => false
76+
t.datetime "updated_at", :null => false
7777
t.text "gravatar_hash"
7878
t.boolean "active", :default => true
7979
t.string "username"
8080
t.boolean "is_admin"
81-
t.string "status"
81+
t.string "status", :default => "active"
8282
end
8383

8484
add_index "users", ["authentication_token"], :name => "index_users_on_authentication_token", :unique => true

0 commit comments

Comments
 (0)