Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Air11 ⮀ artstore ⮀ ruby-2.2.0 ⮀ ⭠ store-v1± ⮀ git commit -m "4.管理者存取後台設定done,但無法登入,所以根本無法測試此章"
- [store-v1 4133804] 4.管理者存取後台設定done,但無法登入,所以根本無法測試此章
- 5 files changed, 28 insertions(+), 6 deletions(-)
- create mode 100644 db/migrate/20160606061858_add_is_admin_to_user.rb
- Air11 ⮀ artstore ⮀ ruby-2.2.0 ⮀ ⭠ store-v1 ⮀ rails c
- Loading development environment (Rails 4.2.2)
- Frame number: 0/20
- DEVELOPMENT [1] artstore(main)> User.last
- User Load (0.3ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
- #<User:0x007f815ebca048> {
- :id => 1,
- :email => "bboyceo@hotmail.com",
- :encrypted_password => "$2a$10$4Fw8jjFB.xv2sH4j4PBeWOAUBT.lKRzXw7BV4k5qXVq.qvJ1j9BmS",
- :reset_password_token => nil,
- :reset_password_sent_at => nil,
- :remember_created_at => nil,
- :sign_in_count => 1,
- :current_sign_in_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
- :last_sign_in_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
- :current_sign_in_ip => "::1",
- :last_sign_in_ip => "::1",
- :created_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
- :updated_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
- :is_admin => false
- }
- DEVELOPMENT [2] artstore(main)> u = User.last
- User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
- #<User:0x007f815f27c080> {
- :id => 1,
- :email => "bboyceo@hotmail.com",
- :encrypted_password => "$2a$10$4Fw8jjFB.xv2sH4j4PBeWOAUBT.lKRzXw7BV4k5qXVq.qvJ1j9BmS",
- :reset_password_token => nil,
- :reset_password_sent_at => nil,
- :remember_created_at => nil,
- :sign_in_count => 1,
- :current_sign_in_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
- :last_sign_in_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
- :current_sign_in_ip => "::1",
- :last_sign_in_ip => "::1",
- :created_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
- :updated_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
- :is_admin => false
- }
- DEVELOPMENT [3] artstore(main)> u.is_admin = true
- true
- DEVELOPMENT [4] artstore(main)> u.save
- (0.1ms) begin transaction
- SQL (1.6ms) UPDATE "users" SET "is_admin" = ?, "updated_at" = ? WHERE "users"."id" = ? [["is_admin", "t"], ["updated_at", "2016-06-06 10:37:49.408369"], ["id", 1]]
- (1.0ms) commit transaction
- true
- DEVELOPMENT [5] artstore(main)> reload!
- Reloading...
- true
- DEVELOPMENT [6] artstore(main)> u=User.last
- User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
- #<User:0x007f815f0dd418> {
- :id => 2,
- :email => "admin@test.com",
- :encrypted_password => "$2a$10$w9fxJXTF1AetZFO3kEOv8eChSdTy1dCu6JxS7Sp51jTgluOHF6Nqa",
- :reset_password_token => nil,
- :reset_password_sent_at => nil,
- :remember_created_at => nil,
- :sign_in_count => 1,
- :current_sign_in_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
- :last_sign_in_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
- :current_sign_in_ip => "::1",
- :last_sign_in_ip => "::1",
- :created_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
- :updated_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
- :is_admin => false
- }
- DEVELOPMENT [7] artstore(main)> u.is_admin
- false
- DEVELOPMENT [8] artstore(main)> u.is_admin=true
- true
- DEVELOPMENT [9] artstore(main)> u.save
- (0.1ms) begin transaction
- SQL (10.4ms) UPDATE "users" SET "is_admin" = ?, "updated_at" = ? WHERE "users"."id" = ? [["is_admin", "t"], ["updated_at", "2016-06-06 10:57:36.294672"], ["id", 2]]
- (1.3ms) commit transaction
- true
- DEVELOPMENT [10] artstore(main)> reload!
- Reloading...
- true
- DEVELOPMENT [11] artstore(main)> u=User.last
- User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
- #<User:0x007f815acc6360> {
- :id => 2,
- :email => "admin@test.com",
- :encrypted_password => "$2a$10$w9fxJXTF1AetZFO3kEOv8eChSdTy1dCu6JxS7Sp51jTgluOHF6Nqa",
- :reset_password_token => nil,
- :reset_password_sent_at => nil,
- :remember_created_at => nil,
- :sign_in_count => 1,
- :current_sign_in_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
- :last_sign_in_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
- :current_sign_in_ip => "::1",
- :last_sign_in_ip => "::1",
- :created_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
- :updated_at => Mon, 06 Jun 2016 10:57:36 UTC +00:00,
- :is_admin => true
- }
- DEVELOPMENT [12] artstore(main)> u=User.first
- User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
- #<User:0x007f815b756578> {
- :id => 1,
- :email => "bboyceo@hotmail.com",
- :encrypted_password => "$2a$10$4Fw8jjFB.xv2sH4j4PBeWOAUBT.lKRzXw7BV4k5qXVq.qvJ1j9BmS",
- :reset_password_token => nil,
- :reset_password_sent_at => nil,
- :remember_created_at => nil,
- :sign_in_count => 1,
- :current_sign_in_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
- :last_sign_in_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
- :current_sign_in_ip => "::1",
- :last_sign_in_ip => "::1",
- :created_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
- :updated_at => Mon, 06 Jun 2016 10:37:49 UTC +00:00,
- :is_admin => true
- }
- DEVELOPMENT [13] artstore(main)> u
- #<User:0x007f815b756578> {
- :id => 1,
- :email => "bboyceo@hotmail.com",
- :encrypted_password => "$2a$10$4Fw8jjFB.xv2sH4j4PBeWOAUBT.lKRzXw7BV4k5qXVq.qvJ1j9BmS",
- :reset_password_token => nil,
- :reset_password_sent_at => nil,
- :remember_created_at => nil,
- :sign_in_count => 1,
- :current_sign_in_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
- :last_sign_in_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
- :current_sign_in_ip => "::1",
- :last_sign_in_ip => "::1",
- :created_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
- :updated_at => Mon, 06 Jun 2016 10:37:49 UTC +00:00,
- :is_admin => true
- }
- DEVELOPMENT [14] artstore(main)> u=User.last
- User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
- #<User:0x007f815ab5c330> {
- :id => 2,
- :email => "admin@test.com",
- :encrypted_password => "$2a$10$w9fxJXTF1AetZFO3kEOv8eChSdTy1dCu6JxS7Sp51jTgluOHF6Nqa",
- :reset_password_token => nil,
- :reset_password_sent_at => nil,
- :remember_created_at => nil,
- :sign_in_count => 1,
- :current_sign_in_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
- :last_sign_in_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
- :current_sign_in_ip => "::1",
- :last_sign_in_ip => "::1",
- :created_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
- :updated_at => Mon, 06 Jun 2016 10:57:36 UTC +00:00,
- :is_admin => true
- }
- DEVELOPMENT [15] artstore(main)>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement