Module: Workarea::Content::AssetLookup

Included in:
BlockType, Fieldset
Defined in:
app/models/workarea/content/asset_lookup.rb

Instance Method Summary collapse

Instance Method Details

#find_asset_id_by_file_name(file_name) ⇒ Object



4
5
6
7
8
9
10
11
# File 'app/models/workarea/content/asset_lookup.rb', line 4

def find_asset_id_by_file_name(file_name)
  proc do
    (
      Workarea::Content::Asset.where(file_name: file_name).first ||
      Workarea::Content::Asset.image_placeholder
    ).try(:id)
  end
end