instance method
as_json
Ruby on Rails edge
Since edgeSignature
as_json(options = nil)
Returns the attachment record’s JSON representation, or nil when no attachment is present.
Parameters
-
optionsopt = nil
Source
# File activestorage/lib/active_storage/attached/one.rb, line 50
def as_json(options = nil)
attached? ? attachment.as_json(options) : nil
end
Defined in activestorage/lib/active_storage/attached/one.rb line 50
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Attached::One