aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal/renderers.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2017-05-29 18:01:50 +0200
committerGitHub <noreply@github.com>2017-05-29 18:01:50 +0200
commit1c275d812f35f53f93cd96184a4f319983766cc5 (patch)
treeb063afeb12dd369f358ad18517e5e8915455df0e /actionpack/lib/action_controller/metal/renderers.rb
parentedc90c858d4cbf1a8e4bfb7347b34348bb30e92c (diff)
downloadrails-1c275d812f35f53f93cd96184a4f319983766cc5.tar.gz
rails-1c275d812f35f53f93cd96184a4f319983766cc5.tar.bz2
rails-1c275d812f35f53f93cd96184a4f319983766cc5.zip
Add option for class_attribute default (#29270)
* Allow a default value to be declared for class_attribute * Convert to using class_attribute default rather than explicit setter * Removed instance_accessor option by mistake * False is a valid default value * Documentation
Diffstat (limited to 'actionpack/lib/action_controller/metal/renderers.rb')
-rw-r--r--actionpack/lib/action_controller/metal/renderers.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal/renderers.rb b/actionpack/lib/action_controller/metal/renderers.rb
index 733aca195d..23c21b0501 100644
--- a/actionpack/lib/action_controller/metal/renderers.rb
+++ b/actionpack/lib/action_controller/metal/renderers.rb
@@ -26,8 +26,7 @@ module ActionController
RENDERERS = Set.new
included do
- class_attribute :_renderers
- self._renderers = Set.new.freeze
+ class_attribute :_renderers, default: Set.new.freeze
end
# Used in <tt>ActionController::Base</tt>