aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-03-31 01:09:39 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2008-03-31 01:09:39 +0000
commit2cf72ad250f7c393e6aa97384768ed803686eb97 (patch)
tree404c8edecdc0528ea83fe0c0f61949fe85743c56 /activesupport/lib/active_support/core_ext
parent181378d1e9b7874148a63d55bd7d01f39c36eac4 (diff)
downloadrails-2cf72ad250f7c393e6aa97384768ed803686eb97.tar.gz
rails-2cf72ad250f7c393e6aa97384768ed803686eb97.tar.bz2
rails-2cf72ad250f7c393e6aa97384768ed803686eb97.zip
Add query methods for superclass_delegating_reader
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9156 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r--activesupport/lib/active_support/core_ext/class/delegating_attributes.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb b/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb
index f5f0ef8779..368317df9b 100644
--- a/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb
+++ b/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb
@@ -19,6 +19,12 @@ class Class
def #{name}
self.class.#{name}
end
+ def self.#{name}?
+ !!#{name}
+ end
+ def #{name}?
+ !!#{name}
+ end
EOS
end
end
@@ -37,4 +43,4 @@ class Class
superclass_delegating_reader(*names)
superclass_delegating_writer(*names)
end
-end \ No newline at end of file
+end