diff options
author | robertomiranda <rjmaltamar@gmail.com> | 2013-01-18 07:56:05 -0500 |
---|---|---|
committer | robertomiranda <rjmaltamar@gmail.com> | 2013-01-18 07:56:05 -0500 |
commit | 7baecc48028e2d0cb57936ad10b9102ed129c9f9 (patch) | |
tree | 77e65e64c592e9f75cb849f851eb4dedb376c2e1 /activerecord/lib/active_record/integration.rb | |
parent | 4095c08729a188e6ebc24f86d60a10bc01053d9b (diff) | |
download | rails-7baecc48028e2d0cb57936ad10b9102ed129c9f9.tar.gz rails-7baecc48028e2d0cb57936ad10b9102ed129c9f9.tar.bz2 rails-7baecc48028e2d0cb57936ad10b9102ed129c9f9.zip |
User Rails 4 find_by
Diffstat (limited to 'activerecord/lib/active_record/integration.rb')
-rw-r--r-- | activerecord/lib/active_record/integration.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/integration.rb b/activerecord/lib/active_record/integration.rb index 7f877a6471..5eaa4c6987 100644 --- a/activerecord/lib/active_record/integration.rb +++ b/activerecord/lib/active_record/integration.rb @@ -19,7 +19,7 @@ module ActiveRecord # <tt>resources :users</tt> route. Normally, +user_path+ will # construct a path with the user object's 'id' in it: # - # user = User.find_by_name('Phusion') + # user = User.find_by(name: 'Phusion') # user_path(user) # => "/users/1" # # You can override +to_param+ in your model to make +user_path+ construct @@ -31,7 +31,7 @@ module ActiveRecord # end # end # - # user = User.find_by_name('Phusion') + # user = User.find_by(name: 'Phusion') # user_path(user) # => "/users/Phusion" def to_param # We can't use alias_method here, because method 'id' optimizes itself on the fly. |