aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2016-12-29 13:14:00 -0500
committerRafael Mendonça França <rafaelmfranca@gmail.com>2016-12-29 17:53:04 -0500
commit931b4b4d64f9b4ea49589aeceed121dea57231c5 (patch)
treee089ae46f5fdf309cdc7425f201257b8e4b09bd5 /activerecord/lib
parent0944182ad7ed70d99b078b22426cbf844edd3f61 (diff)
downloadrails-931b4b4d64f9b4ea49589aeceed121dea57231c5.tar.gz
rails-931b4b4d64f9b4ea49589aeceed121dea57231c5.tar.bz2
rails-931b4b4d64f9b4ea49589aeceed121dea57231c5.zip
Raises IrreversibleOrderError when using last with an irreversible order
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/relation/finder_methods.rb8
1 files changed, 0 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb
index 270511bede..dd92f40dee 100644
--- a/activerecord/lib/active_record/relation/finder_methods.rb
+++ b/activerecord/lib/active_record/relation/finder_methods.rb
@@ -152,14 +152,6 @@ module ActiveRecord
result = result.reverse_order!
limit ? result.reverse : result.first
- rescue ActiveRecord::IrreversibleOrderError
- ActiveSupport::Deprecation.warn(<<-WARNING.squish)
- Finding a last element by loading the relation when SQL ORDER
- can not be reversed is deprecated.
- Rails 5.1 will raise ActiveRecord::IrreversibleOrderError in this case.
- Please call `to_a.last` if you still want to load the relation.
- WARNING
- find_last(limit)
end
# Same as #last but raises ActiveRecord::RecordNotFound if no record