Skip to content

Commit

Permalink
Adding admin field
Browse files Browse the repository at this point in the history
  • Loading branch information
rbarazi committed Apr 13, 2010
1 parent 12501b3 commit 9600418
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README
Expand Up @@ -5,7 +5,7 @@
- Generating User model: 'rails generate devise User'

- Add admin boolean field

- rails generate migration AddAdminToUsers admin:boolean

- URLS
- http://localhost:3000/users/registration/sign_up
Expand Down
9 changes: 9 additions & 0 deletions db/migrate/20100413161535_add_admin_to_users.rb
@@ -0,0 +1,9 @@
class AddAdminToUsers < ActiveRecord::Migration
def self.up
add_column :users, :admin, :boolean
end

def self.down
remove_column :users, :admin
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Expand Up @@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20100411220700) do
ActiveRecord::Schema.define(:version => 20100413161535) do

create_table "order_items", :force => true do |t|
t.integer "order_id"
Expand Down Expand Up @@ -59,6 +59,7 @@
t.string "last_sign_in_ip"
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "admin"
end

add_index "users", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true
Expand Down

0 comments on commit 9600418

Please sign in to comment.