aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-01 01:48:12 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-01 01:48:12 +0100
commit50fbb7405665ba1c2b7c6f23574053a4764cef7f (patch)
tree14ae29163aad9a60288629188e973a195cdc06eb /activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
parentea41a757aab86206278b99deb86e93a760833819 (diff)
downloadrails-50fbb7405665ba1c2b7c6f23574053a4764cef7f.tar.gz
rails-50fbb7405665ba1c2b7c6f23574053a4764cef7f.tar.bz2
rails-50fbb7405665ba1c2b7c6f23574053a4764cef7f.zip
Fix inheritance issue with new callbacks.
Diffstat (limited to 'activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb b/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
index e4d22516c1..2b8e2b544f 100644
--- a/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
+++ b/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
@@ -159,7 +159,7 @@ class Class
# (error out or do the same as other methods above) instead of silently
# moving on). In particular, this makes the return value of this function
# less useful.
- def extlib_inheritable_reader(*ivars)
+ def extlib_inheritable_reader(*ivars, &block)
options = ivars.extract_options!
ivars.each do |ivar|
@@ -178,6 +178,7 @@ class Class
end
RUBY
end
+ instance_variable_set(:"@#{ivar}", yield) if block_given?
end
end