From c178a87b4326edd491922136c0a55bf4b889473d Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Mon, 23 Jun 2008 14:37:50 +0200 Subject: remove call to self.locale from helpers --- actionpack/lib/action_view/helpers/number_helper.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'actionpack/lib/action_view/helpers/number_helper.rb') diff --git a/actionpack/lib/action_view/helpers/number_helper.rb b/actionpack/lib/action_view/helpers/number_helper.rb index 4373d063bb..3e0d5b1db4 100644 --- a/actionpack/lib/action_view/helpers/number_helper.rb +++ b/actionpack/lib/action_view/helpers/number_helper.rb @@ -69,12 +69,9 @@ module ActionView # number_to_currency(1234567890.50, :unit => "£", :separator => ",", :delimiter => "", :format => "%n %u") # # => 1234567890,50 £ def number_to_currency(number, options = {}) - options = options.symbolize_keys - - locale = options[:locale] - locale ||= self.locale if respond_to?(:locale) - - defaults = :'currency.format'.t(locale) || {} + options = options.symbolize_keys + defaults = :'currency.format'.t(options[:locale]) || {} + precision = options[:precision] || defaults[:precision] unit = options[:unit] || defaults[:unit] separator = options[:separator] || defaults[:separator] -- cgit v1.2.3