Sha256: a2681813d9267e0a4a192fd5a8a5e6e8790ba8674a8a66f1c27996b21296a381

Contents?: true

Size: 967 Bytes

Versions: 23

Compression:

Stored size: 967 Bytes

Contents

module Pageflow
  # Generate seed data based on configuration objects
  module ConfigHelper
    # Render seed data that can be used to build file urls.
    #
    # @param [JBuilder] json
    # @param [Configuration] config
    # @since 15.1
    def config_file_url_templates_seed(json, config)
      config.file_types.each do |file_type|
        json.set!(file_type.collection_name) do
          file_type.url_templates.call.each do |key, value|
            json.set!(key, value)
          end
        end
      end
    end

    # Render seed data that can be used to map model names in
    # parent_file_model_type attributes to file collection names.
    #
    # @param [JBuilder] json
    # @param [Configuration] config
    # @since 15.1
    def config_file_model_types_seed(json, config)
      config.file_types.index_by(&:collection_name).each do |collection_name, file_type|
        json.set!(collection_name, file_type.model.name)
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
pageflow-17.0.4 app/helpers/pageflow/config_helper.rb
pageflow-17.0.3 app/helpers/pageflow/config_helper.rb
pageflow-17.0.2 app/helpers/pageflow/config_helper.rb
pageflow-17.0.1 app/helpers/pageflow/config_helper.rb
pageflow-17.0.0 app/helpers/pageflow/config_helper.rb
pageflow-16.2.0 app/helpers/pageflow/config_helper.rb
pageflow-16.1.0 app/helpers/pageflow/config_helper.rb
pageflow-16.0.0 app/helpers/pageflow/config_helper.rb
pageflow-15.8.0 app/helpers/pageflow/config_helper.rb
pageflow-15.7.1 app/helpers/pageflow/config_helper.rb
pageflow-15.7.0 app/helpers/pageflow/config_helper.rb
pageflow-15.6.1 app/helpers/pageflow/config_helper.rb
pageflow-15.6.0 app/helpers/pageflow/config_helper.rb
pageflow-15.5.0 app/helpers/pageflow/config_helper.rb
pageflow-15.4.0 app/helpers/pageflow/config_helper.rb
pageflow-15.3.0 app/helpers/pageflow/config_helper.rb
pageflow-15.2.2 app/helpers/pageflow/config_helper.rb
pageflow-15.2.1 app/helpers/pageflow/config_helper.rb
pageflow-15.2.0 app/helpers/pageflow/config_helper.rb
pageflow-15.1.2 app/helpers/pageflow/config_helper.rb