diff options
author | Sven Fuchs <svenfuchs@artweb-design.de> | 2008-06-22 13:49:38 +0200 |
---|---|---|
committer | Sven Fuchs <svenfuchs@artweb-design.de> | 2008-06-22 13:49:38 +0200 |
commit | 3533dc68120ed40a4ec44ed9900c9035108cfcf1 (patch) | |
tree | c1797a7ec6d078100e4c7f397f0a1e7229fc94ed /actionpack/lib | |
parent | 67fce4671e8bcfe2aa670a89195b20837546183a (diff) | |
download | rails-3533dc68120ed40a4ec44ed9900c9035108cfcf1.tar.gz rails-3533dc68120ed40a4ec44ed9900c9035108cfcf1.tar.bz2 rails-3533dc68120ed40a4ec44ed9900c9035108cfcf1.zip |
check self.locale instead of request.locale in helpers
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/active_record_helper.rb | 2 | ||||
-rwxr-xr-x | actionpack/lib/action_view/helpers/date_helper.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/number_helper.rb | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/active_record_helper.rb b/actionpack/lib/action_view/helpers/active_record_helper.rb index 5ad9d5f76d..716e303a5d 100644 --- a/actionpack/lib/action_view/helpers/active_record_helper.rb +++ b/actionpack/lib/action_view/helpers/active_record_helper.rb @@ -160,7 +160,7 @@ module ActionView count = objects.inject(0) {|sum, object| sum + object.errors.count } locale = options[:locale] - locale ||= request.locale if respond_to?(:request) + locale ||= self.locale if respond_to?(:locale) unless count.zero? html = {} diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index 0337be0744..dbb5d458bf 100755 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -60,7 +60,7 @@ module ActionView # def distance_of_time_in_words(from_time, to_time = 0, include_seconds = false, options = {}) locale = options[:locale] - locale ||= request.locale if respond_to?(:request) + locale ||= self.locale if respond_to?(:locale) from_time = from_time.to_time if from_time.respond_to?(:to_time) to_time = to_time.to_time if to_time.respond_to?(:to_time) @@ -507,7 +507,7 @@ module ActionView # def select_month(date, options = {}, html_options = {}) locale = options[:locale] - locale ||= request.locale if respond_to?(:request) + locale ||= self.locale if respond_to?(:locale) val = date ? (date.kind_of?(Fixnum) ? date : date.month) : '' if options[:use_hidden] diff --git a/actionpack/lib/action_view/helpers/number_helper.rb b/actionpack/lib/action_view/helpers/number_helper.rb index 9d98036f2d..dc56817c12 100644 --- a/actionpack/lib/action_view/helpers/number_helper.rb +++ b/actionpack/lib/action_view/helpers/number_helper.rb @@ -72,7 +72,7 @@ module ActionView options = options.symbolize_keys locale = options[:locale] - locale ||= request.locale if respond_to?(:request) + locale ||= self.locale if respond_to?(:locale) defaults = :'currency.format'.t(locale) || {} precision = options[:precision] || defaults[:precision] |