Skip to content
Browse files

No need to binds be optional

  • Loading branch information...
1 parent b0a9853 commit cc987c904429859c218614215ec53b6a8ff7b1f6 @rafaelfranca rafaelfranca committed Mar 13, 2014
View
4 activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
@@ -40,7 +40,7 @@ def select_value(arel, name = nil, binds = [])
# 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 @@ def last_inserted_id(result)
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

0 comments on commit cc987c9

Please sign in to comment.
Something went wrong with that request. Please try again.