Skip to content

Commit

Permalink
Use attr_accessor for Rails.{application,cache,logger}
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaland committed Dec 1, 2012
1 parent 583cc11 commit b9d1d2c
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions railties/lib/rails.rb
Expand Up @@ -24,13 +24,7 @@ module Rails
autoload :InfoController, 'rails/info_controller' autoload :InfoController, 'rails/info_controller'


class << self class << self
def application attr_accessor :application, :cache, :logger
@application ||= nil
end

def application=(application)
@application = application
end


# The Configuration instance used to configure the Rails environment # The Configuration instance used to configure the Rails environment
def configuration def configuration
Expand Down Expand Up @@ -64,14 +58,6 @@ def initialized?
application.initialized? application.initialized?
end end


def logger
@logger ||= nil
end

def logger=(logger)
@logger = logger
end

def backtrace_cleaner def backtrace_cleaner
@backtrace_cleaner ||= begin @backtrace_cleaner ||= begin
# Relies on Active Support, so we have to lazy load to postpone definition until AS has been loaded # Relies on Active Support, so we have to lazy load to postpone definition until AS has been loaded
Expand All @@ -95,14 +81,6 @@ def env=(environment)
@_env = ActiveSupport::StringInquirer.new(environment) @_env = ActiveSupport::StringInquirer.new(environment)
end end


def cache
@cache ||= nil
end

def cache=(cache)
@cache = cache
end

# Returns all rails groups for loading based on: # Returns all rails groups for loading based on:
# #
# * The Rails environment; # * The Rails environment;
Expand Down

0 comments on commit b9d1d2c

Please sign in to comment.