Rails 4 deprecated find_by fix

ZirconCode 11 anni fa
parent
commit
2fa1243dd4
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      db/seeds.rb

+ 1 - 1
db/seeds.rb

@@ -1,7 +1,7 @@
1 1
 # This file should contain all the record creation needed to seed the database with its default values.
2 2
 # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3 3
 
4
-user = User.find_or_initialize_by_email("admin@example.com")
4
+user = User.find_or_initialize_by(:email => "admin@example.com")
5 5
 user.username = "admin"
6 6
 user.password = "password"
7 7
 user.password_confirmation = "password"