aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorrobertomiranda <rjmaltamar@gmail.com>2013-01-18 07:56:05 -0500
committerrobertomiranda <rjmaltamar@gmail.com>2013-01-18 07:56:05 -0500
commit7baecc48028e2d0cb57936ad10b9102ed129c9f9 (patch)
tree77e65e64c592e9f75cb849f851eb4dedb376c2e1 /activemodel
parent4095c08729a188e6ebc24f86d60a10bc01053d9b (diff)
downloadrails-7baecc48028e2d0cb57936ad10b9102ed129c9f9.tar.gz
rails-7baecc48028e2d0cb57936ad10b9102ed129c9f9.tar.bz2
rails-7baecc48028e2d0cb57936ad10b9102ed129c9f9.zip
User Rails 4 find_by
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/dirty.rb2
-rw-r--r--activemodel/lib/active_model/secure_password.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/dirty.rb b/activemodel/lib/active_model/dirty.rb
index 6e67cd2285..789bdd74bf 100644
--- a/activemodel/lib/active_model/dirty.rb
+++ b/activemodel/lib/active_model/dirty.rb
@@ -46,7 +46,7 @@ module ActiveModel
#
# A newly instantiated object is unchanged:
#
- # person = Person.find_by_name('Uncle Bob')
+ # person = Person.find_by(name: 'Uncle Bob')
# person.changed? # => false
#
# Change the name:
diff --git a/activemodel/lib/active_model/secure_password.rb b/activemodel/lib/active_model/secure_password.rb
index 6644b60609..762716a343 100644
--- a/activemodel/lib/active_model/secure_password.rb
+++ b/activemodel/lib/active_model/secure_password.rb
@@ -37,8 +37,8 @@ module ActiveModel
# user.save # => true
# user.authenticate('notright') # => false
# user.authenticate('mUc3m00RsqyRe') # => user
- # User.find_by_name('david').try(:authenticate, 'notright') # => false
- # User.find_by_name('david').try(:authenticate, 'mUc3m00RsqyRe') # => user
+ # User.find_by(name: 'david').try(:authenticate, 'notright') # => false
+ # User.find_by(name: 'david').try(:authenticate, 'mUc3m00RsqyRe') # => user
def has_secure_password(options = {})
# Load bcrypt-ruby only when has_secure_password is used.
# This is to avoid ActiveModel (and by extension the entire framework)