class Administrate::Field::Shrine

Public Instance Methods

cached_value() click to toggle source
# File lib/administrate/field/shrine.rb, line 35
def cached_value
  resource.send("cached_#{attribute}_data")
end
regular_url() click to toggle source
# File lib/administrate/field/shrine.rb, line 19
def regular_url
  data.try(:url)
end
url() click to toggle source

we should first try the regular data.url because if the versions are generated in the background by a worker they won't be available immediately after submitting the form however, once data.url is available data.url won't work, so we're covered in both cases

# File lib/administrate/field/shrine.rb, line 15
def url
  (regular_url || version_url).to_s
end
url_only?() click to toggle source
# File lib/administrate/field/shrine.rb, line 27
def url_only?
  options.fetch(:url_only, false)
end
version() click to toggle source
# File lib/administrate/field/shrine.rb, line 31
def version
  options.fetch(:version, nil)
end
version_url() click to toggle source
# File lib/administrate/field/shrine.rb, line 23
def version_url
  data.try(:[], version).try(:url)
end