aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorLachlan Sylvester <lachlan.sylvester@publicisfrontfoot.com.au>2018-04-12 10:08:13 +1000
committerLachlan Sylvester <lachlan.sylvester@publicisfrontfoot.com.au>2018-04-12 10:17:31 +1000
commit115bbdac2b8e11ec92241b839665c5811cc8a2fb (patch)
treedcdc8c7fd86e546015206e8b6a7da6679bfa5e70 /activerecord/test/cases
parent733f3cbea8d81170a16425c46d194f3e51e1422e (diff)
downloadrails-115bbdac2b8e11ec92241b839665c5811cc8a2fb.tar.gz
rails-115bbdac2b8e11ec92241b839665c5811cc8a2fb.tar.bz2
rails-115bbdac2b8e11ec92241b839665c5811cc8a2fb.zip
don't check for immutability when setting skip_preloading as it doesn't effect the arel and the arel may already be generated by fresh_when
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/relation/mutation_test.rb2
-rw-r--r--activerecord/test/cases/relation_test.rb8
2 files changed, 9 insertions, 1 deletions
diff --git a/activerecord/test/cases/relation/mutation_test.rb b/activerecord/test/cases/relation/mutation_test.rb
index d6351bfe88..f82ecd4449 100644
--- a/activerecord/test/cases/relation/mutation_test.rb
+++ b/activerecord/test/cases/relation/mutation_test.rb
@@ -59,7 +59,7 @@ module ActiveRecord
assert_equal [], relation.extending_values
end
- (Relation::SINGLE_VALUE_METHODS - [:lock, :reordering, :reverse_order, :create_with, :skip_query_cache, :skip_preloading]).each do |method|
+ (Relation::SINGLE_VALUE_METHODS - [:lock, :reordering, :reverse_order, :create_with, :skip_query_cache]).each do |method|
test "##{method}!" do
assert relation.public_send("#{method}!", :foo).equal?(relation)
assert_equal :foo, relation.public_send("#{method}_value")
diff --git a/activerecord/test/cases/relation_test.rb b/activerecord/test/cases/relation_test.rb
index 4e75371147..0f446e06aa 100644
--- a/activerecord/test/cases/relation_test.rb
+++ b/activerecord/test/cases/relation_test.rb
@@ -315,6 +315,14 @@ module ActiveRecord
assert_equal "type cast from database", UpdateAllTestModel.first.body
end
+ def test_skip_preloading_after_arel_has_been_generated
+ assert_nothing_raised do
+ relation = Comment.all
+ relation.arel
+ relation.skip_preloading!
+ end
+ end
+
private
def skip_if_sqlite3_version_includes_quoting_bug