Permalink
Browse files

Revert "Merge pull request #31006 from rails/kamipo/ordinal_methods_s…

…hould_respect_loaded_records"

This reverts commit 0f79ab9, reversing
changes made to d575f7f.

This PR philosophically conflicts with #30800 and Matthew thinks we
should hold off merging this until we find concensus. Reverting since
we're about to cut a release for 5.2.
  • Loading branch information...
eileencodes committed Nov 26, 2017
1 parent cdc4675 commit d7ab5710916f8ee58a970312e9bc9276022fe3a6
Showing with 0 additions and 17 deletions.
  1. +0 −1 activerecord/lib/active_record/relation.rb
  2. +0 −16 activerecord/test/cases/finder_test.rb
@@ -544,7 +544,6 @@ def exec_queries(&block)
end
@records.each(&:readonly!) if readonly_value
@offsets = {} unless @offsets.empty?
@loaded = true
@records
@@ -691,22 +691,6 @@ def test_take_and_first_and_last_with_integer_should_return_an_array
assert_kind_of Array, Topic.last(5)
end
def test_first_should_respect_loaded_records
authors = Author.order(:name)
assert_equal authors(:bob), authors.first
aaron = authors.create!(name: "Aaron")
authors.load
assert_no_queries do
assert_equal aaron, authors.first
assert_equal authors(:bob), authors.second
assert_not_equal authors.first, authors.second
end
end
def test_unexisting_record_exception_handling
assert_raise(ActiveRecord::RecordNotFound) {
Topic.find(1).parent

0 comments on commit d7ab571

Please sign in to comment.