Permalink
Browse files

Use attr_accessor for Rails.{application,cache,logger}

  • Loading branch information...
1 parent 583cc11 commit b9d1d2cddae952650b5f3fd3bbfc5ed7d80f95fc @bmaland bmaland committed Dec 1, 2012
Showing with 1 addition and 23 deletions.
  1. +1 −23 railties/lib/rails.rb
View
@@ -24,13 +24,7 @@ module Rails
autoload :InfoController, 'rails/info_controller'
class << self
- def application
- @application ||= nil
- end
-
- def application=(application)
- @application = application
- end
+ attr_accessor :application, :cache, :logger
# The Configuration instance used to configure the Rails environment
def configuration
@@ -64,14 +58,6 @@ def initialized?
application.initialized?
end
- def logger
- @logger ||= nil
- end
-
- def logger=(logger)
- @logger = logger
- end
-
def backtrace_cleaner
@backtrace_cleaner ||= begin
# 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)
@_env = ActiveSupport::StringInquirer.new(environment)
end
- def cache
- @cache ||= nil
- end
-
- def cache=(cache)
- @cache = cache
- end
-
# Returns all rails groups for loading based on:
#
# * The Rails environment;

0 comments on commit b9d1d2c

Please sign in to comment.