diff options
Diffstat (limited to 'actionpack/lib/action_view/template')
-rw-r--r-- | actionpack/lib/action_view/template/handler.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_view/template/resolver.rb | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/template/handler.rb b/actionpack/lib/action_view/template/handler.rb index 221d1bd5c5..8ecc911519 100644 --- a/actionpack/lib/action_view/template/handler.rb +++ b/actionpack/lib/action_view/template/handler.rb @@ -1,5 +1,5 @@ -require "active_support/core_ext/class/inheritable_attributes" require "action_dispatch/http/mime_type" +require 'active_support/core_ext/class/attribute' # Legacy TemplateHandler stub module ActionView @@ -23,7 +23,7 @@ module ActionView end class Template::Handler - extlib_inheritable_accessor :default_format + class_attribute :default_format self.default_format = Mime::HTML def self.call(template) diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index af5d6f6d18..6878067f7c 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -1,5 +1,6 @@ require "pathname" require "active_support/core_ext/class" +require "active_support/core_ext/array/wrap" require "action_view/template" module ActionView @@ -11,7 +12,7 @@ module ActionView def self.register_detail(name, options = {}) registered_details[name] = lambda do |val| - val ||= yield + val = Array.wrap(val || yield) val |= [nil] unless options[:allow_nil] == false val end |