Class: SynergyDefaultTheme::Engine

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

Class Method Summary collapse

Class Method Details

.activateObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/synergy_default_theme.rb', line 11

def self.activate
  Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
    Rails.env.production? ? require(c) : load(c)
  end
  
  Admin::PagesController.cache_sweeper :page_sweeper
  Admin::TrackersController.cache_sweeper :tracker_sweeper
  
  if defined?(Spree::RecentlyViewed) && Spree::RecentlyViewed::Config.instance
    Spree::RecentlyViewed::Config.set :recently_viewed_products_max_count => 3
  end
  
  if Spree::Config.instance
    Spree::Config.set :products_per_page => 9
  end

  Image.attachment_definitions[:attachment].merge!({
    :styles => {
            :mini    => '40x40>',
            :small   => '120x120>',
            :product => '200x200>',
            :large   => '600x600>'
    }
  })
end