Class: Integral::ListItem
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Integral::ListItem
- Defined in:
- app/models/integral/list_item.rb
Overview
Represents an item within a particular list
Class Method Summary collapse
-
.types_collection ⇒ Array
List of types available for a list item.
Instance Method Summary collapse
Methods inherited from ApplicationRecord
Class Method Details
.types_collection ⇒ Array
Returns list of types available for a list item.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/models/integral/list_item.rb', line 29 def self.types_collection collection = [ [I18n.t('integral.backend.lists.items.type.basic'), 'Integral::Basic', data: { true_value: 'Integral::Basic' }], [I18n.t('integral.backend.lists.items.type.link'), 'Integral::Link', data: { true_value: 'Integral::Link' }] ] ActsAsListable.objects.each do |listable| object_data = { object_type: listable.to_s, true_value: 'Integral::Object', resource_selector_title: 'Select resource..', resource_selector_url: listable.integral_resource_selector_url, icon: listable.integral_icon } collection << [listable.model_name.human, listable.to_s, data: object_data] end collection end |
Instance Method Details
#basic? ⇒ Boolean
58 59 60 |
# File 'app/models/integral/list_item.rb', line 58 def basic? false end |
#has_children? ⇒ Boolean
62 63 64 |
# File 'app/models/integral/list_item.rb', line 62 def has_children? children.present? end |
#link? ⇒ Boolean
54 55 56 |
# File 'app/models/integral/list_item.rb', line 54 def link? false end |
#object? ⇒ Boolean
50 51 52 |
# File 'app/models/integral/list_item.rb', line 50 def object? false end |