diff options
author | Sean Griffin <sean@thoughtbot.com> | 2015-01-27 13:42:02 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2015-01-27 16:10:03 -0700 |
commit | b06f64c3480cd389d14618540d62da4978918af0 (patch) | |
tree | 626a163d2885fd3b91e58c6bcbf60ec3824a51f0 /activerecord/lib/active_record/relation/calculations.rb | |
parent | d66ffb656e0cfbb4216f030c8e0669509567e362 (diff) | |
download | rails-b06f64c3480cd389d14618540d62da4978918af0.tar.gz rails-b06f64c3480cd389d14618540d62da4978918af0.tar.bz2 rails-b06f64c3480cd389d14618540d62da4978918af0.zip |
Remove Relation#bind_params
`bound_attributes` is now used universally across the board, removing
the need for the conversion layer. These changes are mostly mechanical,
with the exception of the log subscriber. Additional, we had to
implement `hash` on the attribute objects, so they could be used as a
key for query caching.
Diffstat (limited to 'activerecord/lib/active_record/relation/calculations.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/calculations.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb index 724bba5f87..83745bc169 100644 --- a/activerecord/lib/active_record/relation/calculations.rb +++ b/activerecord/lib/active_record/relation/calculations.rb @@ -166,7 +166,7 @@ module ActiveRecord relation.select_values = column_names.map { |cn| columns_hash.key?(cn) ? arel_table[cn] : cn } - result = klass.connection.select_all(relation.arel, nil, bind_values) + result = klass.connection.select_all(relation.arel, nil, bound_attributes) result.cast_values(klass.column_types) end end @@ -244,7 +244,7 @@ module ActiveRecord query_builder = relation.arel end - result = @klass.connection.select_all(query_builder, nil, bind_values) + result = @klass.connection.select_all(query_builder, nil, bound_attributes) row = result.first value = row && row.values.first column = result.column_types.fetch(column_alias) do @@ -300,7 +300,7 @@ module ActiveRecord relation.group_values = group relation.select_values = select_values - calculated_data = @klass.connection.select_all(relation, nil, relation.bind_values) + calculated_data = @klass.connection.select_all(relation, nil, relation.bound_attributes) if association key_ids = calculated_data.collect { |row| row[group_aliases.first] } |