diff options
author | Lauro Caetano <laurocaetano1@gmail.com> | 2013-12-03 16:33:34 -0200 |
---|---|---|
committer | Lauro Caetano <laurocaetano1@gmail.com> | 2013-12-03 17:09:58 -0200 |
commit | 2a517e7291d6f93b6ca3d8c56fc8559c48089c28 (patch) | |
tree | 7559121e8ecc9bc4fb51e477093a4f3bd0e060da /activerecord/lib/active_record | |
parent | be5527b8e8fcc25946b128fe78db10d5bee2a483 (diff) | |
download | rails-2a517e7291d6f93b6ca3d8c56fc8559c48089c28.tar.gz rails-2a517e7291d6f93b6ca3d8c56fc8559c48089c28.tar.bz2 rails-2a517e7291d6f93b6ca3d8c56fc8559c48089c28.zip |
Fix offset with last.
Closes #7441
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index d91d6367a3..3963f2b3e0 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -384,7 +384,7 @@ module ActiveRecord @records.last else @last ||= - if offset_value || limit_value + if limit_value to_a.last else reverse_order.limit(1).to_a.first |