diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-01-08 12:18:32 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2016-01-08 12:18:32 +0900 |
commit | 2827fcd2f96e1554236fe435c73b767eebeb4e94 (patch) | |
tree | 15c503c8453243b137f3dfde523f7a8d4f5c8a42 /activerecord | |
parent | 7595c59523a07ce6febd40efc5ab6064a63cc1ae (diff) | |
download | rails-2827fcd2f96e1554236fe435c73b767eebeb4e94.tar.gz rails-2827fcd2f96e1554236fe435c73b767eebeb4e94.tar.bz2 rails-2827fcd2f96e1554236fe435c73b767eebeb4e94.zip |
Fix `select_values` method signature for consistency
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb | 4 |
2 files changed, 4 insertions, 4 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 4d12c19b47..74bb030bba 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb @@ -58,8 +58,8 @@ 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, [] + def select_values(arel, name = nil, binds = []) + arel, binds = binds_from_relation arel, binds select_rows(to_sql(arel, binds), name, binds).map(&:first) end diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb index ba3dc18398..02b5b83630 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb @@ -52,8 +52,8 @@ module ActiveRecord end end - def select_values(arel, name = nil) - arel, binds = binds_from_relation arel, [] + def select_values(arel, name = nil, binds = []) + arel, binds = binds_from_relation arel, binds sql = to_sql(arel, binds) execute_and_clear(sql, name, binds) do |result| if result.nfields > 0 |