Can't Dup NilClass

Hello,

I put the method below in my controller, but I feel it should be in my
Billing::Shared module so it can be used by other controllers as well.

However, this introduces the Can’t Dup NilClass message when running a
server in development mode.

Do you have any suggestions how I can DRY this code up and keep class
caching OFF?

All the best,
CmdJohnson


##############################################################################

setup_gateway

not so DRY:

copied from Billing::Shared to circumvent Can’t Dup NilClass bug

##############################################################################

def setup_gateway
test = true
test = false if RAILS_ENV.eql? “production”
options = {
:login => property(:paypal_api_login),
:password => property(:paypal_api_password),
:signature => property(:paypal_api_signature),
:test => test
}

ActiveMerchant::Billing::PaypalExpressRecurringGateway.new(options)

end