diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-09 17:05:02 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-09 17:05:02 +0000 |
commit | c83683202a6f7aa88facc795189fcbf8549760cf (patch) | |
tree | 9ea448236a167037fd6866e77fe853138de45a19 /activesupport | |
parent | cbd367b7fa232be37781bba1063c38d5ac36e94b (diff) | |
download | rails-c83683202a6f7aa88facc795189fcbf8549760cf.tar.gz rails-c83683202a6f7aa88facc795189fcbf8549760cf.tar.bz2 rails-c83683202a6f7aa88facc795189fcbf8549760cf.zip |
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
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/class_inheritable_attributes.rb | 5 |
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 |