Class: Workarea::Search::Admin::Content

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

Overview

This class exists to represent system content (as opposed to content pages defined in Content::Page). Content will only get indexed in the Admin index in this case.

Instance Method Summary collapse

Methods included from Releasable

#facets, #status

Methods inherited from Workarea::Search::Admin

#as_document, #created_at, #facets, for, #id, jump_to, #jump_to_param, #jump_to_search_text, #keywords, #name, #releasable?, #sanitized_keywords, #status, #updated_at

Methods included from Elasticsearch::Document

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

Instance Method Details

#jump_to_positionObject



23
24
25
# File 'app/models/workarea/search/admin/content.rb', line 23

def jump_to_position
  6
end

#jump_to_route_helperObject



27
28
29
# File 'app/models/workarea/search/admin/content.rb', line 27

def jump_to_route_helper
  'content_path'
end

#jump_to_textObject



19
20
21
# File 'app/models/workarea/search/admin/content.rb', line 19

def jump_to_text
  model.name
end

#search_textObject



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

def search_text
  "system content page #{model.name}"
end

#should_be_indexed?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'app/models/workarea/search/admin/content.rb', line 11

def should_be_indexed?
  model.system?
end

#typeObject



15
16
17
# File 'app/models/workarea/search/admin/content.rb', line 15

def type
  'system_page'
end