Class: Pageflow::ThemeCustomization

Inherits:
ApplicationRecord show all
Defined in:
app/models/pageflow/theme_customization.rb

Overview

Override theme options and upload theme files for an entry type on a per account basis.

Since:

  • 15.7

Instance Method Summary collapse

Instance Method Details

#entry_typeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 15.7



32
33
34
# File 'app/models/pageflow/theme_customization.rb', line 32

def entry_type
  Pageflow.config.entry_types.find_by_name!(entry_type_name)
end

#overridesHash<Symbol, Object>

Options that were passed to [ThemeCustomizations#update].

Returns:

  • (Hash<Symbol, Object>)

Since:

  • 15.7



17
18
19
# File 'app/models/pageflow/theme_customization.rb', line 17

def overrides
  super&.deep_symbolize_keys || {}
end

#selected_filesHash<Symbol, ThemeCustomizationFile>

Theme customization files that have been assigned a role via [ThemeCustomizations#update].

Returns:

Since:

  • 15.7



25
26
27
28
29
# File 'app/models/pageflow/theme_customization.rb', line 25

def selected_files
  selected_file_ids.compact.transform_values do |id|
    selected_files_by_id[id]
  end
end