No need to binds be optional

上级 b4d4d93d
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册