mesmo problema, coloque este código dentro de config\spree_money.rb, mas
continuo tendo o mesmo erro!!!
Em domingo, 24 de fevereiro de 2013 14h12min44s UTC-3, Giulliano Bueno
escreveu:
Hi everyone,
I had an issue with BRL currency in this version and solved it changing
Spree::Money initialize method as follow. If it is not the best way to do
it, please let me know. Thanks!
require 'money'
module Spree
class Money
attr_reader :money
def initialize(amount, options={})
@money = ::Money.parse([amount, (options[:currency] ||
Spree::Config[:currency])].join)
@options = {}
@options[:with_currency] = true if Spree::Config[:display_currency]
@options[:symbol_position] =
Spree::Config[:currency_symbol_position].to_sym
@options[:no_cents] = true if Spree::Config[:hide_cents]
# I18n.t([:'number.currency.format.separator',
:'number.currency.format.delimiter'])
# new code
@options[:separator] = I18n.t([:'number.currency.format.separator'])
@options[:delimiter] = I18n.t([:'number.currency.format.delimiter'])
#end new code
@options.merge!(options)
# Must be a symbol because the Money gem doesn't do the conversion
@options[:symbol_position] = @options[:symbol_position].to_sym
end
def to_s
@money.format(@options)
end
def ==(obj)
@money == obj.money
end
end
end
--I had an issue with BRL currency in this version and solved it changing
Spree::Money initialize method as follow. If it is not the best way to do
it, please let me know. Thanks!
require 'money'
module Spree
class Money
attr_reader :money
def initialize(amount, options={})
@money = ::Money.parse([amount, (options[:currency] ||
Spree::Config[:currency])].join)
@options = {}
@options[:with_currency] = true if Spree::Config[:display_currency]
@options[:symbol_position] =
Spree::Config[:currency_symbol_position].to_sym
@options[:no_cents] = true if Spree::Config[:hide_cents]
# I18n.t([:'number.currency.format.separator',
:'number.currency.format.delimiter'])
# new code
@options[:separator] = I18n.t([:'number.currency.format.separator'])
@options[:delimiter] = I18n.t([:'number.currency.format.delimiter'])
#end new code
@options.merge!(options)
# Must be a symbol because the Money gem doesn't do the conversion
@options[:symbol_position] = @options[:symbol_position].to_sym
end
def to_s
@money.format(@options)
end
def ==(obj)
@money == obj.money
end
end
end
You received this message because you are subscribed to the Google Groups "Spree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.