Module: Indexable

Extended by:
ActiveSupport::Concern
Included in:
Collection, Creator, Model
Defined in:
app/models/concerns/indexable.rb

Instance Method Summary collapse

Instance Method Details

#ai_indexable? ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
30
31
32
33
34
35
36
# File 'app/models/concerns/indexable.rb', line 27

def ai_indexable?
  case ai_indexable
  when nil
    inherited_ai_indexable?
  when "yes"
    true
  else
    false
  end
end

#indexable? ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
19
20
21
22
23
24
25
# File 'app/models/concerns/indexable.rb', line 16

def indexable?
  case indexable
  when nil
    inherited_indexable?
  when "yes"
    true
  else
    false
  end
end

#inherited_ai_indexable? ⇒ Boolean

Returns:

  • (Boolean)


48
49
50
51
52
53
54
55
56
# File 'app/models/concerns/indexable.rb', line 48

def inherited_ai_indexable?
  if is_a?(Collection) && collection
    collection.ai_indexable?
  elsif respond_to?(:creator) && creator
    creator.ai_indexable?
  else
    SiteSettings.default_ai_indexable
  end
end

#inherited_indexable? ⇒ Boolean

Returns:

  • (Boolean)


38
39
40
41
42
43
44
45
46
# File 'app/models/concerns/indexable.rb', line 38

def inherited_indexable?
  if is_a?(Collection) && collection
    collection.indexable?
  elsif respond_to?(:creator) && creator
    creator.indexable?
  else
    SiteSettings.default_indexable
  end
end

#public_and_indexable? ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/models/concerns/indexable.rb', line 12

def public_and_indexable?
  respond_to?(:indexable) && indexable? && public?
end