Class: Pageflow::EntryTemplate
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Pageflow::EntryTemplate
- Includes:
- SerializedConfiguration, ThemeReferencer
- Defined in:
- app/models/pageflow/entry_template.rb
Instance Method Summary collapse
- #copy_defaults_to(revision) ⇒ Object
- #default_share_providers ⇒ Object
- #entry_type ⇒ Object
- #resolve_widgets(options = {}) ⇒ Object
- #share_providers ⇒ Object
- #share_providers=(share_providers) ⇒ Object
- #translated_entry_type_name ⇒ Object
Methods included from SerializedConfiguration
Methods included from ThemeReferencer
Instance Method Details
#copy_defaults_to(revision) ⇒ Object
32 33 34 35 |
# File 'app/models/pageflow/entry_template.rb', line 32 def copy_defaults_to(revision) .copy_all_to(revision) copy_attributes_to(revision) end |
#default_share_providers ⇒ Object
45 46 47 48 |
# File 'app/models/pageflow/entry_template.rb', line 45 def default_share_providers self[:default_share_providers].presence || hashify_provider_array(Pageflow.config.default_share_providers) end |
#entry_type ⇒ Object
20 21 22 |
# File 'app/models/pageflow/entry_template.rb', line 20 def entry_type Pageflow.config.entry_types.find_by_name!(entry_type_name) end |
#resolve_widgets(options = {}) ⇒ Object
28 29 30 |
# File 'app/models/pageflow/entry_template.rb', line 28 def ( = {}) .resolve(Pageflow.config_for(self), ) end |
#share_providers ⇒ Object
41 42 43 |
# File 'app/models/pageflow/entry_template.rb', line 41 def share_providers default_share_providers end |
#share_providers=(share_providers) ⇒ Object
37 38 39 |
# File 'app/models/pageflow/entry_template.rb', line 37 def share_providers=(share_providers) self.default_share_providers = share_providers end |
#translated_entry_type_name ⇒ Object
24 25 26 |
# File 'app/models/pageflow/entry_template.rb', line 24 def translated_entry_type_name I18n.t("activerecord.values.pageflow/entry.type_names.#{entry_type_name}") end |