aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorBogdan Gusiev <agresso@gmail.com>2016-08-16 14:47:11 +0300
committerBogdan Gusiev <agresso@gmail.com>2016-08-23 13:11:06 +0300
commit5b42628e79e85b8697a42f5f566f7cbfd1160847 (patch)
tree10639fdd2aaf84f4bfc382822350db03f5d1dc7d /activerecord/test
parent82ec6b36065e91fe0ec5a87f9419840618ce2c5d (diff)
downloadrails-5b42628e79e85b8697a42f5f566f7cbfd1160847.tar.gz
rails-5b42628e79e85b8697a42f5f566f7cbfd1160847.tar.bz2
rails-5b42628e79e85b8697a42f5f566f7cbfd1160847.zip
Remove over meta programming in AR::Relation
Introduced low level methods #set_value and #get_value for setting query attributes: relation.set_value(:where, {id: 1}) relation.get_value(:includes) Used those internally when working with relation's attributes at the abstract level
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/relation_test.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/test/cases/relation_test.rb b/activerecord/test/cases/relation_test.rb
index 951b83e87b..0bd4ee3e36 100644
--- a/activerecord/test/cases/relation_test.rb
+++ b/activerecord/test/cases/relation_test.rb
@@ -40,9 +40,10 @@ module ActiveRecord
def test_initialize_single_values
relation = Relation.new(FakeKlass, :b, nil)
- (Relation::SINGLE_VALUE_METHODS - [:create_with]).each do |method|
+ (Relation::SINGLE_VALUE_METHODS - [:create_with, :readonly]).each do |method|
assert_nil relation.send("#{method}_value"), method.to_s
end
+ assert_equal false, relation.readonly_value
value = relation.create_with_value
assert_equal({}, value)
assert_predicate value, :frozen?