aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application.rb
diff options
context:
space:
mode:
authorDillon Welch <daw0328@gmail.com>2018-03-29 19:29:55 -0700
committerDillon Welch <daw0328@gmail.com>2018-07-23 15:37:06 -0700
commitd108288c2f684233298f97f18ac00de0b016deaa (patch)
tree0656fd6f20d662d854a3fc93e80dfbc0baec063d /railties/lib/rails/application.rb
parenta4398e412c042b297039cc216f6536b0c048bd9c (diff)
downloadrails-d108288c2f684233298f97f18ac00de0b016deaa.tar.gz
rails-d108288c2f684233298f97f18ac00de0b016deaa.tar.bz2
rails-d108288c2f684233298f97f18ac00de0b016deaa.zip
Turn on performance based cops
Use attr_reader/attr_writer instead of methods method is 12% slower Use flat_map over map.flatten(1) flatten is 66% slower Use hash[]= instead of hash.merge! with single arguments merge! is 166% slower See https://github.com/rails/rails/pull/32337 for more conversation
Diffstat (limited to 'railties/lib/rails/application.rb')
-rw-r--r--railties/lib/rails/application.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index e346d5cc3a..bc5cd230fc 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -373,9 +373,7 @@ module Rails
@config ||= Application::Configuration.new(self.class.find_root(self.class.called_from))
end
- def config=(configuration) #:nodoc:
- @config = configuration
- end
+ attr_writer :config
# Returns secrets added to config/secrets.yml.
#
@@ -413,9 +411,7 @@ module Rails
end
end
- def secrets=(secrets) #:nodoc:
- @secrets = secrets
- end
+ attr_writer :secrets
# The secret_key_base is used as the input secret to the application's key generator, which in turn
# is used to create all MessageVerifiers/MessageEncryptors, including the ones that sign and encrypt cookies.