Module: Refinery::PageImages

Includes:
ActiveSupport::Configurable
Defined in:
lib/refinery/page_images.rb,
lib/refinery/page_images/engine.rb,
lib/refinery/page_images/extension.rb,
lib/refinery/page_images/configuration.rb

Defined Under Namespace

Modules: Extension Classes: Engine

Class Method Summary collapse

Class Method Details

.attach!Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/refinery/page_images.rb', line 18

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

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

  Refinery::Image.send :has_many, :image_pages, :dependent => :destroy
end

.factory_pathsObject



14
15
16
# File 'lib/refinery/page_images.rb', line 14

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

.rootObject



10
11
12
# File 'lib/refinery/page_images.rb', line 10

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