diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2017-06-04 16:12:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-04 16:12:40 +0200 |
commit | 704209b017277f3404dacded2b0bb5c6d81aeb6d (patch) | |
tree | 13588b7d79a1986b3429aa5a671f80418515fecb /railties | |
parent | 51abe8fe6ea997ad879eb5a19842144047268117 (diff) | |
parent | b6b0c99ff3e8ace3f42813154dbe4b8ad6a98e6c (diff) | |
download | rails-704209b017277f3404dacded2b0bb5c6d81aeb6d.tar.gz rails-704209b017277f3404dacded2b0bb5c6d81aeb6d.tar.bz2 rails-704209b017277f3404dacded2b0bb5c6d81aeb6d.zip |
Merge pull request #29294 from gsamokovarov/attributes-default
Introduce mattr_accessor default option
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/info.rb | 5 | ||||
-rw-r--r-- | railties/lib/rails/test_unit/minitest_plugin.rb | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/railties/lib/rails/info.rb b/railties/lib/rails/info.rb index fc064dac32..db08d578c0 100644 --- a/railties/lib/rails/info.rb +++ b/railties/lib/rails/info.rb @@ -5,8 +5,9 @@ module Rails # Rails::InfoController responses. These include the active Rails version, # Ruby version, Rack version, and so on. module Info - mattr_accessor :properties - class << (@@properties = []) + mattr_accessor :properties, default: [] + + class << @@properties def names map(&:first) end diff --git a/railties/lib/rails/test_unit/minitest_plugin.rb b/railties/lib/rails/test_unit/minitest_plugin.rb index 7a852d1109..5d0cf1305f 100644 --- a/railties/lib/rails/test_unit/minitest_plugin.rb +++ b/railties/lib/rails/test_unit/minitest_plugin.rb @@ -134,7 +134,7 @@ module Minitest end end - mattr_reader(:run_via) { RunVia.new } + mattr_reader :run_via, default: RunVia.new end # Put Rails as the first plugin minitest initializes so other plugins |