removes user_id column from User model to use idiomatic Rails automatic IDs

This commit is contained in:
Joseph Mastey
2017-10-07 09:34:26 -06:00
parent c4f0b91534
commit b6c2259b88
29 changed files with 421 additions and 430 deletions
+10 -7
View File
@@ -6,13 +6,16 @@ class UserFixture
end
def self.normal_user
password = "thi$ 1s cOmplExEr"
user = User.new(first_name: "Joe", last_name: "Schmoe",
email: "joe@schmoe.com", password: password, password_confirmation: password)
def user.clear_password
"thi$ 1s cOmplExEr"
password = 'thi$ 1s cOmplExEr'
User.create!(first_name: 'Joe', last_name: 'Schmoe', email: 'joe@schmoe.com',
password: password, password_confirmation: password).tap do |user|
def user.clear_password
'thi$ 1s cOmplExEr'
end
end
user.save!
user
end
def self.admin_user
User.where(admin: true).first
end
end