Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit c83683202a6f7aa88facc795189fcbf8549760cf 1 parent cbd367b
@dhh dhh authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 activesupport/lib/class_inheritable_attributes.rb
View
5 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
Please sign in to comment.
Something went wrong with that request. Please try again.