Sha256: ba4024bd5d5b3ef45c2b3274a5628db462e6e158a2cd630b682c5028c806c9b3

Contents?: true

Size: 849 Bytes

Versions: 3

Compression:

Stored size: 849 Bytes

Contents

require 'refinerycms-core'

module Refinery
  autoload :PageOptionsGenerator, 'generators/refinery/page_options_generator'

  module PageOptions

    class << self
      def root
        @root ||= Pathname.new(File.expand_path('../../../', __FILE__))
      end

      def factory_paths
        @factory_paths ||= [ root.join('spec', 'factories').to_s ]
      end

      def attach!
        require 'refinery/page'
        require 'refinery/page_options/extension'

        config.enabled_models.each do |model_class_name|
          unless (model_class = model_class_name.safe_constantize)
            Rails.logger.warn "PageOptions is unable to find model class: #{model_class_name}"
            next
          end
          model_class.send :has_many_page_options
        end
      end
    end

    require 'refinery/page_options/engine'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
refinerycms-page-options-2.1.2 lib/refinery/page_options.rb
refinerycms-page-options-2.1.1 lib/refinery/page_options.rb
refinerycms-page-options-2.1.0 lib/refinery/page_options.rb