aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/null_relation.rb
diff options
context:
space:
mode:
authorPaul Nikitochkin <paul.nikitochkin@gmail.com>2013-07-14 17:32:56 +0300
committerPaul Nikitochkin <paul.nikitochkin@gmail.com>2013-09-28 11:21:34 +0300
commit8fb0de2cae8e6f26c71ab8e4267d3841a38a29b9 (patch)
tree389517698e39008e1d8e817f2b27d71cd8107207 /activerecord/lib/active_record/null_relation.rb
parent3e0a60e4e2316ee696bdcf1c115582f8f450ad07 (diff)
downloadrails-8fb0de2cae8e6f26c71ab8e4267d3841a38a29b9.tar.gz
rails-8fb0de2cae8e6f26c71ab8e4267d3841a38a29b9.tar.bz2
rails-8fb0de2cae8e6f26c71ab8e4267d3841a38a29b9.zip
Removed where_values_hash from AR::NullRelation
In order to build associated records for owners which has not been saved need to get where values to use as default attributes. But for new record owner uses `ActiveRecord::NullRelation` which override `where_values_hash` to return empty hash stub. `where_values_hash` is not used to invoke any sql query, but good to build others chains (even will be never executed) like: ```ruby post = Post.new admin_comment = post.admin_comments.build assert_equal 'Admin', admin_comment.author ``` Closes #11376, #11676, #11675
Diffstat (limited to 'activerecord/lib/active_record/null_relation.rb')
-rw-r--r--activerecord/lib/active_record/null_relation.rb4
1 files changed, 0 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/null_relation.rb b/activerecord/lib/active_record/null_relation.rb
index d166f0dd66..716020e7e7 100644
--- a/activerecord/lib/active_record/null_relation.rb
+++ b/activerecord/lib/active_record/null_relation.rb
@@ -42,10 +42,6 @@ module ActiveRecord
""
end
- def where_values_hash
- {}
- end
-
def count(*)
0
end