Hi there
I’ve got a copy of the ‘Beginning Ruby on Rails Ecommerce’ book and am
trying to integrate ActiveMerchant into my app.
My order.rb file has the line:
‘include ActiveMerchant::Billing’
per the book.
My Order model also has, amongst other things, the following validation:
’ validates_inclusion_of :billing_country, :in =>
Address::COUNTRIES.map {|disp, value| value}’
where the constant COUNTRIES has been defined in my Address model.
From the console, if I try and create an Order.new, I get the following
error:
‘uninitialized constant COUNTRIES’ and reference to the above
validation.
Any clues on whether I’m actually including ActiveMerchant the correct
way and why it is clashing with my Address model?
I thought I only needed to 'require ‘active_merchant’ in my
environment.rb file?
All my gateway tests, including the remote ones, pass out of the box,
but I just have to integrate into my app.
Any clues would be appreciated.