instance method
value
Ruby on Rails 8.0.4
Since v7.1.6Signature
value()
Returns the query result. If the query wasn’t completed yet, accessing #value will block until the query completes. If the query failed, #value will raise the corresponding error.
Source
# File activerecord/lib/active_record/promise.rb, line 20
def value
return @value if defined? @value
result = @future_result.result
@value = if @block
@block.call(result)
else
result
end
end
Defined in activerecord/lib/active_record/promise.rb line 20
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Promise