Sha256: dbdbedc558cbbcae5546bad150c8b0852b673768e99a8708c995d29cc473b66c

Contents?: true

Size: 587 Bytes

Versions: 6

Compression:

Stored size: 587 Bytes

Contents

class AddCurrencyCodeOptionToPaypalGateway < ActiveRecord::Migration
  def self.up
    currency_code = GatewayOption.create(:name => "currency_code",
                                         :textarea => false,
                                         :description => "The currency you want to use (EUR, USD, refer to paypal doc)")
    gateway = Gateway.find(:first, :conditions => [ 'name = ?', "Paypal - Website Payments Pro"] )
    raise 'Failed to find Paypal gateway to add currency_code' unless gateway
    gateway.gateway_options << currency_code
  end

  def self.down
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
spree-enriquez-0.9.4 vendor/extensions/payment_gateway/db/migrate/20090517173727_add_currency_code_option_to_paypal_gateway.rb
spree-0.9.4 vendor/extensions/payment_gateway/db/migrate/20090517173727_add_currency_code_option_to_paypal_gateway.rb
spree-0.9.3 vendor/extensions/payment_gateway/db/migrate/20090517173727_add_currency_code_option_to_paypal_gateway.rb
spree-0.9.2 vendor/extensions/payment_gateway/db/migrate/20090517173727_add_currency_code_option_to_paypal_gateway.rb
spree-0.9.1 vendor/extensions/payment_gateway/db/migrate/20090517173727_add_currency_code_option_to_paypal_gateway.rb
spree-0.9.0 vendor/extensions/payment_gateway/db/migrate/20090517173727_add_currency_code_option_to_paypal_gateway.rb