2010-11-28 14:31:31 +00:00
|
|
|
require 'spree_core'
|
|
|
|
|
|
|
|
module SpreePaypalExpress
|
|
|
|
class Engine < Rails::Engine
|
2011-09-07 16:25:38 +00:00
|
|
|
engine_name 'spree_paypal_express'
|
2010-11-28 14:31:31 +00:00
|
|
|
|
|
|
|
config.autoload_paths += %W(#{config.root}/lib)
|
|
|
|
|
|
|
|
def self.activate
|
|
|
|
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
|
|
|
|
Rails.env.production? ? require(c) : load(c)
|
|
|
|
end
|
2011-10-08 16:07:53 +00:00
|
|
|
end
|
2011-01-24 19:56:04 +00:00
|
|
|
|
2011-10-08 16:07:53 +00:00
|
|
|
initializer "spree_paypal_express.register.payment_methods" do |app|
|
|
|
|
app.config.spree.payment_methods += [
|
2011-11-17 15:53:07 +00:00
|
|
|
Spree::BillingIntegration::PaypalExpress,
|
|
|
|
Spree::BillingIntegration::PaypalExpressUk
|
2011-10-08 16:07:53 +00:00
|
|
|
]
|
2010-11-28 14:31:31 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
config.to_prepare &method(:activate).to_proc
|
|
|
|
end
|
|
|
|
end
|