Skip to content

Commit 3282d76

Browse files
committed
missing_key': Missing setting 'to_ary' in (Settingslogic::MissingSetting)
Fix Array#flatten on an array containing a Settingslogic object binarylogic#36
1 parent 020cced commit 3282d76

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/settingslogic.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ def initialize(hash_or_file = self.class.source, section = nil)
113113
# Called for dynamically-defined keys, and also the first key deferenced at the top-level, if load! is not used.
114114
# Otherwise, create_accessors! (called by new) will have created actual methods for each key.
115115
def method_missing(name, *args, &block)
116+
super if name === :to_ary # delegate to Hash
117+
super if name === :to_str # delegate to Hash
118+
116119
key = name.to_s
117120
return missing_key("Missing setting '#{key}' in #{@section}") unless has_key? key
118121
value = fetch(key)

0 commit comments

Comments
 (0)