aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-03-13 16:53:05 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-03-13 16:53:05 -0300
commita0936a1635a86c5cc6b3afa331503aac1e87ced7 (patch)
tree7c2eedbe1cca3bbc8469e9cff9577ddb3f7706a7 /activerecord
parentb4d4d93d6cf3bb7ced4a923fbe89a835a04c83a6 (diff)
downloadrails-a0936a1635a86c5cc6b3afa331503aac1e87ced7.tar.gz
rails-a0936a1635a86c5cc6b3afa331503aac1e87ced7.tar.bz2
rails-a0936a1635a86c5cc6b3afa331503aac1e87ced7.zip
No need to binds be optional
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
index dd1962e4d6..e0516c0773 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
@@ -40,7 +40,7 @@ module ActiveRecord
# Returns an array of the values of the first column in a select:
# select_values("SELECT id FROM companies LIMIT 3") => [1,2,3]
def select_values(arel, name = nil)
- arel, binds = binds_from_relation arel
+ arel, binds = binds_from_relation arel, []
select_rows(to_sql(arel, binds), name, binds).map(&:first)
end
@@ -380,7 +380,7 @@ module ActiveRecord
row && row.first
end
- def binds_from_relation(relation, binds = [])
+ def binds_from_relation(relation, binds)
if relation.is_a?(Relation) && binds.blank?
relation, binds = relation.arel, relation.bind_values
end