From a0936a1635a86c5cc6b3afa331503aac1e87ced7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 13 Mar 2014 16:53:05 -0300 Subject: No need to binds be optional --- .../active_record/connection_adapters/abstract/database_statements.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord') 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 -- cgit v1.2.3