aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/active_record_helper.rb2
-rwxr-xr-xactionpack/lib/action_view/helpers/date_helper.rb4
-rw-r--r--actionpack/lib/action_view/helpers/number_helper.rb2
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]