Advertisement
Guest User

Untitled

a guest
Jun 7th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.20 KB | None | 0 0
  1. Air11 ⮀ artstore ⮀ ruby-2.2.0 ⮀ ⭠ store-v1± ⮀ git commit -m "4.管理者存取後台設定done,但無法登入,所以根本無法測試此章"
  2. [store-v1 4133804] 4.管理者存取後台設定done,但無法登入,所以根本無法測試此章
  3. 5 files changed, 28 insertions(+), 6 deletions(-)
  4. create mode 100644 db/migrate/20160606061858_add_is_admin_to_user.rb
  5. Air11 ⮀ artstore ⮀ ruby-2.2.0 ⮀ ⭠ store-v1 ⮀ rails c
  6. Loading development environment (Rails 4.2.2)
  7.  
  8. Frame number: 0/20
  9. DEVELOPMENT [1] artstore(main)> User.last
  10. User Load (0.3ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
  11. #<User:0x007f815ebca048> {
  12. :id => 1,
  13. :email => "bboyceo@hotmail.com",
  14. :encrypted_password => "$2a$10$4Fw8jjFB.xv2sH4j4PBeWOAUBT.lKRzXw7BV4k5qXVq.qvJ1j9BmS",
  15. :reset_password_token => nil,
  16. :reset_password_sent_at => nil,
  17. :remember_created_at => nil,
  18. :sign_in_count => 1,
  19. :current_sign_in_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
  20. :last_sign_in_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
  21. :current_sign_in_ip => "::1",
  22. :last_sign_in_ip => "::1",
  23. :created_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
  24. :updated_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
  25. :is_admin => false
  26. }
  27. DEVELOPMENT [2] artstore(main)> u = User.last
  28. User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
  29. #<User:0x007f815f27c080> {
  30. :id => 1,
  31. :email => "bboyceo@hotmail.com",
  32. :encrypted_password => "$2a$10$4Fw8jjFB.xv2sH4j4PBeWOAUBT.lKRzXw7BV4k5qXVq.qvJ1j9BmS",
  33. :reset_password_token => nil,
  34. :reset_password_sent_at => nil,
  35. :remember_created_at => nil,
  36. :sign_in_count => 1,
  37. :current_sign_in_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
  38. :last_sign_in_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
  39. :current_sign_in_ip => "::1",
  40. :last_sign_in_ip => "::1",
  41. :created_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
  42. :updated_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
  43. :is_admin => false
  44. }
  45. DEVELOPMENT [3] artstore(main)> u.is_admin = true
  46. true
  47. DEVELOPMENT [4] artstore(main)> u.save
  48. (0.1ms) begin transaction
  49. 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]]
  50. (1.0ms) commit transaction
  51. true
  52. DEVELOPMENT [5] artstore(main)> reload!
  53. Reloading...
  54. true
  55. DEVELOPMENT [6] artstore(main)> u=User.last
  56. User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
  57. #<User:0x007f815f0dd418> {
  58. :id => 2,
  59. :email => "admin@test.com",
  60. :encrypted_password => "$2a$10$w9fxJXTF1AetZFO3kEOv8eChSdTy1dCu6JxS7Sp51jTgluOHF6Nqa",
  61. :reset_password_token => nil,
  62. :reset_password_sent_at => nil,
  63. :remember_created_at => nil,
  64. :sign_in_count => 1,
  65. :current_sign_in_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
  66. :last_sign_in_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
  67. :current_sign_in_ip => "::1",
  68. :last_sign_in_ip => "::1",
  69. :created_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
  70. :updated_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
  71. :is_admin => false
  72. }
  73. DEVELOPMENT [7] artstore(main)> u.is_admin
  74. false
  75. DEVELOPMENT [8] artstore(main)> u.is_admin=true
  76. true
  77. DEVELOPMENT [9] artstore(main)> u.save
  78. (0.1ms) begin transaction
  79. 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]]
  80. (1.3ms) commit transaction
  81. true
  82. DEVELOPMENT [10] artstore(main)> reload!
  83. Reloading...
  84. true
  85. DEVELOPMENT [11] artstore(main)> u=User.last
  86. User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
  87. #<User:0x007f815acc6360> {
  88. :id => 2,
  89. :email => "admin@test.com",
  90. :encrypted_password => "$2a$10$w9fxJXTF1AetZFO3kEOv8eChSdTy1dCu6JxS7Sp51jTgluOHF6Nqa",
  91. :reset_password_token => nil,
  92. :reset_password_sent_at => nil,
  93. :remember_created_at => nil,
  94. :sign_in_count => 1,
  95. :current_sign_in_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
  96. :last_sign_in_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
  97. :current_sign_in_ip => "::1",
  98. :last_sign_in_ip => "::1",
  99. :created_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
  100. :updated_at => Mon, 06 Jun 2016 10:57:36 UTC +00:00,
  101. :is_admin => true
  102. }
  103. DEVELOPMENT [12] artstore(main)> u=User.first
  104. User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
  105. #<User:0x007f815b756578> {
  106. :id => 1,
  107. :email => "bboyceo@hotmail.com",
  108. :encrypted_password => "$2a$10$4Fw8jjFB.xv2sH4j4PBeWOAUBT.lKRzXw7BV4k5qXVq.qvJ1j9BmS",
  109. :reset_password_token => nil,
  110. :reset_password_sent_at => nil,
  111. :remember_created_at => nil,
  112. :sign_in_count => 1,
  113. :current_sign_in_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
  114. :last_sign_in_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
  115. :current_sign_in_ip => "::1",
  116. :last_sign_in_ip => "::1",
  117. :created_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
  118. :updated_at => Mon, 06 Jun 2016 10:37:49 UTC +00:00,
  119. :is_admin => true
  120. }
  121. DEVELOPMENT [13] artstore(main)> u
  122. #<User:0x007f815b756578> {
  123. :id => 1,
  124. :email => "bboyceo@hotmail.com",
  125. :encrypted_password => "$2a$10$4Fw8jjFB.xv2sH4j4PBeWOAUBT.lKRzXw7BV4k5qXVq.qvJ1j9BmS",
  126. :reset_password_token => nil,
  127. :reset_password_sent_at => nil,
  128. :remember_created_at => nil,
  129. :sign_in_count => 1,
  130. :current_sign_in_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
  131. :last_sign_in_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
  132. :current_sign_in_ip => "::1",
  133. :last_sign_in_ip => "::1",
  134. :created_at => Mon, 06 Jun 2016 10:32:21 UTC +00:00,
  135. :updated_at => Mon, 06 Jun 2016 10:37:49 UTC +00:00,
  136. :is_admin => true
  137. }
  138. DEVELOPMENT [14] artstore(main)> u=User.last
  139. User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
  140. #<User:0x007f815ab5c330> {
  141. :id => 2,
  142. :email => "admin@test.com",
  143. :encrypted_password => "$2a$10$w9fxJXTF1AetZFO3kEOv8eChSdTy1dCu6JxS7Sp51jTgluOHF6Nqa",
  144. :reset_password_token => nil,
  145. :reset_password_sent_at => nil,
  146. :remember_created_at => nil,
  147. :sign_in_count => 1,
  148. :current_sign_in_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
  149. :last_sign_in_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
  150. :current_sign_in_ip => "::1",
  151. :last_sign_in_ip => "::1",
  152. :created_at => Mon, 06 Jun 2016 10:44:48 UTC +00:00,
  153. :updated_at => Mon, 06 Jun 2016 10:57:36 UTC +00:00,
  154. :is_admin => true
  155. }
  156. DEVELOPMENT [15] artstore(main)>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement