instance method
select_one
Ruby on Rails 7.2.3
Since v2.2.3Signature
select_one(arel, name = nil, binds = [], async: false)
Returns a record hash with the column names as keys and column values as values.
Parameters
-
arelreq -
nameopt = nil -
bindsopt = [] -
asynckey = false
Source
# File activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb, line 84
def select_one(arel, name = nil, binds = [], async: false)
select_all(arel, name, binds, async: async).then(&:first)
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb line 84
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::DatabaseStatements