Class: SpreeCompareProducts::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/spree_compare_products.rb

Class Method Summary collapse

Class Method Details

.activateObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/spree_compare_products.rb', line 10

def self.activate
  Dir.glob(File.join(File.dirname(__FILE__), '../app/**/*_decorator*.rb')) do |c|
    Rails.env.production? ? require(c) : load(c)
  end

  Taxonomy.class_eval do
    include SpreeCompareProducts::ComparableContainer
  end

  Taxon.class_eval do
    include SpreeCompareProducts::ComparableContainer

    def is_comparable?
      comparable? || taxonomy.comparable?
    end
  end
end