aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/class_inheritable_attributes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/class_inheritable_attributes.rb')
-rw-r--r--activesupport/lib/class_inheritable_attributes.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/class_inheritable_attributes.rb b/activesupport/lib/class_inheritable_attributes.rb
index 39312e8d5b..5ad5a362f6 100644
--- a/activesupport/lib/class_inheritable_attributes.rb
+++ b/activesupport/lib/class_inheritable_attributes.rb
@@ -24,6 +24,11 @@ module ClassInheritableAttributes # :nodoc:
write_inheritable_attribute(key, read_inheritable_attribute(key) + elements)
end
+ def write_inheritable_hash(key, hash)
+ write_inheritable_attribute(key, {}) if read_inheritable_attribute(key).nil?
+ write_inheritable_attribute(key, read_inheritable_attribute(key).merge(hash))
+ end
+
def read_inheritable_attribute(key)
inheritable_attributes[key]
end