aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal/configuration.rb
blob: 5c829853b76745bc3f4012132e3463b79d664a4e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module ActionController
  module Configuration
    extend ActiveSupport::Concern
    
    def config
      @config ||= self.class.config
    end
    
    def config=(config)
      @config = config
    end
    
    module ClassMethods
      def default_config
        @default_config ||= {}
      end
      
      def config
        self.config ||= default_config
      end
      
      def config=(config)
        @config = ActiveSupport::OrderedHash.new
        @config.merge!(config)
      end
    end
  end
end