Class: Workarea::Search::Admin::ContentAsset

Inherits:
Workarea::Search::Admin show all
Defined in:
app/models/workarea/search/admin/content_asset.rb

Instance Method Summary collapse

Methods inherited from Workarea::Search::Admin

#as_document, #created_at, for, #id, jump_to, #jump_to_param, #jump_to_route_helper, #jump_to_search_text, #keywords, #name, #releasable?, #sanitized_keywords, #type, #updated_at

Methods included from Elasticsearch::Document

all, #as_bulk_document, #as_document, current_index_prefix, #destroy, #initialize, #save

Instance Method Details

#facetsObject



26
27
28
# File 'app/models/workarea/search/admin/content_asset.rb', line 26

def facets
  super.merge(file_type: model.type, image_dimensions: image_dimensions)
end

#jump_to_positionObject



22
23
24
# File 'app/models/workarea/search/admin/content_asset.rb', line 22

def jump_to_position
  8
end

#jump_to_textObject



18
19
20
# File 'app/models/workarea/search/admin/content_asset.rb', line 18

def jump_to_text
  "#{model.name} - #{model.file_name}"
end

#search_textObject



9
10
11
12
13
14
15
16
# File 'app/models/workarea/search/admin/content_asset.rb', line 9

def search_text
  [
    'content asset',
    model.name,
    model.file_name,
    model.tag_list
  ].join(' ')
end

#should_be_indexed?Boolean

Returns:

  • (Boolean)


30
31
32
33
34
# File 'app/models/workarea/search/admin/content_asset.rb', line 30

def should_be_indexed?
  !model.image_placeholder? &&
    !model.open_graph_placeholder? &&
    !model.favicon_placeholder?
end

#statusObject



5
6
7
# File 'app/models/workarea/search/admin/content_asset.rb', line 5

def status
  'active'
end