aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorBenjamin Quorning <benjamin@quorning.net>2016-06-23 15:46:20 +0200
committerBenjamin Quorning <benjamin@quorning.net>2016-06-24 11:43:23 +0200
commitaf834fb2c03358fe9a1b8fd9ec36eb5658a63260 (patch)
tree26e7b33a780b031e0b9885e63cfa4d4f62faaaaf /activerecord
parente292ce8a4f4559aed6faef58e03ced649513cf2f (diff)
downloadrails-af834fb2c03358fe9a1b8fd9ec36eb5658a63260.tar.gz
rails-af834fb2c03358fe9a1b8fd9ec36eb5658a63260.tar.bz2
rails-af834fb2c03358fe9a1b8fd9ec36eb5658a63260.zip
Remove MySQL::DatabaseStatements#select_one
The implementation from abstract/database_statements.rb seems to work just fine. And with ActiveRecord::Result now implementing an optimized #first method, the performance concerns previously addressed in https://github.com/rails/rails/commit/bf79aa4fc14aeb2646331e767038acf0b77e9e7f should not be an issue.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb13
1 files changed, 0 insertions, 13 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb b/activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb
index 13c9b6cbd9..87f0ff7d85 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb
@@ -13,19 +13,6 @@ module ActiveRecord
result
end
- # Returns a record hash with the column names as keys and column values
- # as values.
- def select_one(arel, name = nil, binds = [])
- arel, binds = binds_from_relation(arel, binds)
- @connection.query_options.merge!(as: :hash)
- select_result(to_sql(arel, binds), name, binds) do |result|
- @connection.next_result while @connection.more_results?
- result.first
- end
- ensure
- @connection.query_options.merge!(as: :array)
- end
-
# Returns an array of arrays containing the field values.
# Order is the same as that returned by +columns+.
def select_rows(sql, name = nil, binds = [])