Skip to content
Browse files

Make InheritableOptions's constructor more flexible.

  • Loading branch information...
1 parent 918dc27 commit 8cda132136a766621b4c976cb1df7007d12ee6b5 @thedarkone thedarkone committed Sep 27, 2010
View
2 activesupport/lib/active_support/configurable.rb
@@ -30,7 +30,7 @@ def config
superclass.config.inheritable_copy
else
# create a new "anonymous" class that will host the compiled reader methods
- Class.new(Configuration).new({})
+ Class.new(Configuration).new
end
end
View
8 activesupport/lib/active_support/ordered_options.rb
@@ -36,8 +36,12 @@ def method_missing(name, *args)
end
class InheritableOptions < OrderedOptions
- def initialize(parent)
- super() { |h,k| parent[k] }
+ def initialize(parent = nil)
+ if parent
+ super() { |h,k| parent[k] }
+ else
+ super()
+ end
end
def inheritable_copy

0 comments on commit 8cda132

Please sign in to comment.
Something went wrong with that request. Please try again.