aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-06-16 08:01:35 -0300
committerJosé Valim <jose.valim@gmail.com>2011-06-16 08:01:35 -0300
commitf2c0fb32c0dce7f8da0ce446e2d2f0cba5fd44b3 (patch)
tree8ef6575204ce1e314fa16a5eeb9f9c91667e5f30 /actionpack/lib/action_view/helpers
parent8775ffa37231d381cba34f0ecacb8a7bbcf0573f (diff)
downloadrails-f2c0fb32c0dce7f8da0ce446e2d2f0cba5fd44b3.tar.gz
rails-f2c0fb32c0dce7f8da0ce446e2d2f0cba5fd44b3.tar.bz2
rails-f2c0fb32c0dce7f8da0ce446e2d2f0cba5fd44b3.zip
Remove usage of memoizable from ActionPack.
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/date_helper.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb
index 56e3af683b..6a724749f4 100644
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionpack/lib/action_view/helpers/date_helper.rb
@@ -621,7 +621,6 @@ module ActionView
end
class DateTimeSelector #:nodoc:
- extend ActiveSupport::Memoizable
include ActionView::Helpers::TagHelper
DEFAULT_PREFIX = 'date'.freeze
@@ -786,11 +785,12 @@ module ActionView
# Returns translated month names, but also ensures that a custom month
# name array has a leading nil element.
def month_names
- month_names = @options[:use_month_names] || translated_month_names
- month_names.unshift(nil) if month_names.size < 13
- month_names
+ @month_names ||= begin
+ month_names = @options[:use_month_names] || translated_month_names
+ month_names.unshift(nil) if month_names.size < 13
+ month_names
+ end
end
- memoize :month_names
# Returns translated month names.
# => [nil, "January", "February", "March",
@@ -825,9 +825,8 @@ module ActionView
end
def date_order
- @options[:order] || translated_date_order
+ @date_order ||= @options[:order] || translated_date_order
end
- memoize :date_order
def translated_date_order
I18n.translate(:'date.order', :locale => @options[:locale]) || []