Permalink
Browse files

No need to binds be optional

  • Loading branch information...
1 parent cf57853 commit d2b0653d7b556238cb449a718e51730c2a785258 @rafaelfranca rafaelfranca committed Mar 13, 2014
@@ -42,7 +42,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
@@ -387,7 +387,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 d2b0653

Please sign in to comment.