Skip to content

Commit

Permalink
Make InheritableOptions's constructor more flexible.
Browse files Browse the repository at this point in the history
  • Loading branch information
thedarkone committed Sep 27, 2010
1 parent 918dc27 commit 8cda132
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/configurable.rb
Expand Up @@ -30,7 +30,7 @@ def config
superclass.config.inheritable_copy superclass.config.inheritable_copy
else else
# create a new "anonymous" class that will host the compiled reader methods # create a new "anonymous" class that will host the compiled reader methods
Class.new(Configuration).new({}) Class.new(Configuration).new
end end
end end


Expand Down
8 changes: 6 additions & 2 deletions activesupport/lib/active_support/ordered_options.rb
Expand Up @@ -36,8 +36,12 @@ def method_missing(name, *args)
end end


class InheritableOptions < OrderedOptions class InheritableOptions < OrderedOptions
def initialize(parent) def initialize(parent = nil)
super() { |h,k| parent[k] } if parent
super() { |h,k| parent[k] }
else
super()
end
end end


def inheritable_copy def inheritable_copy
Expand Down

0 comments on commit 8cda132

Please sign in to comment.