lib/pageflow/theme_customizations.rb
# Upload a file that shall be used to customize a theme. Uploading
# the file does not result in visible changes. Call [#update] and
# assign a role via the `file_ids` parameter.
#
# @return [ThemeCustomizationFile]
Upload a file that shall be used to customize a theme. Uploading
the file does not result in visible changes. Call [#update] and
assign a role via the `file_ids` parameter.
Upload a file that shall be used to customize a theme . Uploading the file does not result in visible changes . Call [ #update ] and assign a role via the ` file_ids ` parameter .
def upload_file(account:, entry_type_name:, type_name:, attachment:)
      theme_customization_file =
        ThemeCustomization
        .find_or_create_by(account: account, entry_type_name: entry_type_name)
        .uploaded_files
        .build(type_name: type_name)
      theme_customization_file.attachment = attachment
      theme_customization_file.save!
      theme_customization_file
    end
def upload_file ( account : , entry_type_name : , type_name : , attachment : ) theme_customization_file = ThemeCustomization . find_or_create_by ( account : account , entry_type_name : entry_type_name ) . uploaded_files . build ( type_name : type_name ) theme_customization_file . attachment = attachment theme_customization_file . save! theme_customization_file end
Upload a file that shall be used to customize a theme.
Upload a file that shall be used to customize a theme .
# Assign attachment in separate step to make sure theme # customization association (which is used to look up Paperclip # styles and validation content type) has already been set when Paperclip runs.
None
ThemeCustomizationFile
account
entry_type_name
type_name
attachment