From c83683202a6f7aa88facc795189fcbf8549760cf Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 9 Jan 2005 17:05:02 +0000 Subject: Added write_inheritable_hash to use with conditional filters in Action Pack git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@353 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/class_inheritable_attributes.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activesupport/lib') 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 -- cgit v1.2.3