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 |
# 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 = { icon: listable.[:icon], object_type: listable.to_s, record_selector: listable.to_s.parameterize, true_value: 'Integral::Object' } collection << [listable.[:record_title], listable.to_s, data: object_data] end collection end |
Instance Method Details
#basic? ⇒ Boolean
57 58 59 |
# File 'app/models/integral/list_item.rb', line 57 def basic? false end |
#has_children? ⇒ Boolean
61 62 63 |
# File 'app/models/integral/list_item.rb', line 61 def has_children? children.present? end |
#link? ⇒ Boolean
53 54 55 |
# File 'app/models/integral/list_item.rb', line 53 def link? false end |
#object? ⇒ Boolean
49 50 51 |
# File 'app/models/integral/list_item.rb', line 49 def object? false end |