Permalink
Browse files

Added write_inheritable_hash to use with conditional filters in Actio…

…n Pack

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@353 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent cbd367b commit c83683202a6f7aa88facc795189fcbf8549760cf @dhh dhh committed Jan 9, 2005
Showing with 5 additions and 0 deletions.
  1. +5 −0 activesupport/lib/class_inheritable_attributes.rb
@@ -24,6 +24,11 @@ def write_inheritable_array(key, elements)
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

0 comments on commit c836832

Please sign in to comment.