Class: SpreePaypalStandard::Engine

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

Class Method Summary collapse

Class Method Details

.activateObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/spree_paypal_standard.rb', line 8

def self.activate
  Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
    Rails.env.production? ? require(c) : load(c)
  end
  if File.basename( $0 ) != "rake"
    [
      BillingIntegration::PaypalStandard
    ].each{|gw|
      begin
        gw.register
      rescue Exception => e
        $stderr.puts "Error registering gateway #{gw}: #{e}"
      end
    }
  end
  CheckoutController.class_eval do
    include ::Spree::PaypalStandard
  end
  ActionView::Base.class_eval do
    include ::ActiveMerchant::Billing::Integrations::ActionViewHelper
  end

end