Skip to content

Commit bef3308

Browse files
Merge pull request rails#8395 from bmaland/attr_accessors
Use attr_accessor for Rails.{application,cache,logger}
2 parents 3f95908 + b9d1d2c commit bef3308

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

railties/lib/rails.rb

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,7 @@ module Rails
2424
autoload :InfoController, 'rails/info_controller'
2525

2626
class << self
27-
def application
28-
@application ||= nil
29-
end
30-
31-
def application=(application)
32-
@application = application
33-
end
27+
attr_accessor :application, :cache, :logger
3428

3529
# The Configuration instance used to configure the Rails environment
3630
def configuration
@@ -64,14 +58,6 @@ def initialized?
6458
application.initialized?
6559
end
6660

67-
def logger
68-
@logger ||= nil
69-
end
70-
71-
def logger=(logger)
72-
@logger = logger
73-
end
74-
7561
def backtrace_cleaner
7662
@backtrace_cleaner ||= begin
7763
# Relies on Active Support, so we have to lazy load to postpone definition until AS has been loaded
@@ -95,14 +81,6 @@ def env=(environment)
9581
@_env = ActiveSupport::StringInquirer.new(environment)
9682
end
9783

98-
def cache
99-
@cache ||= nil
100-
end
101-
102-
def cache=(cache)
103-
@cache = cache
104-
end
105-
10684
# Returns all rails groups for loading based on:
10785
#
10886
# * The Rails environment;

0 commit comments

Comments
 (0)