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.
# 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