diff options
author | Nicholas Seckar <nseckar@gmail.com> | 2006-02-03 22:36:44 +0000 |
---|---|---|
committer | Nicholas Seckar <nseckar@gmail.com> | 2006-02-03 22:36:44 +0000 |
commit | 62aa0603b79965c4f48711bc2adf033551be2439 (patch) | |
tree | b1df32a7139c3cd0f82ccb67f8b627e981566a32 | |
parent | ad9cabd77c26cf58c7179a19caa9efb7e5e0c831 (diff) | |
download | rails-62aa0603b79965c4f48711bc2adf033551be2439.tar.gz rails-62aa0603b79965c4f48711bc2adf033551be2439.tar.bz2 rails-62aa0603b79965c4f48711bc2adf033551be2439.zip |
Don't allow Reloadable to be included into Modules
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3527 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | activesupport/CHANGELOG | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/reloadable.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG index 89ec622abc..7c92daf5ae 100644 --- a/activesupport/CHANGELOG +++ b/activesupport/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Don't allow Reloadable to be included into Modules. + * Remove LoadingModule. [Nicholas Seckar] * Add documentation for Reloadable::OnlySubclasses. [Nicholas Seckar] diff --git a/activesupport/lib/active_support/reloadable.rb b/activesupport/lib/active_support/reloadable.rb index 179e04a0fe..c71b2fa4bd 100644 --- a/activesupport/lib/active_support/reloadable.rb +++ b/activesupport/lib/active_support/reloadable.rb @@ -3,7 +3,9 @@ module Reloadable class << self def included(base) #nodoc: - if base.is_a?(Class) && ! base.respond_to?(:reloadable?) + raise TypeError, "Only Classes can be Reloadable!" unless base.is_a? Class + + unless base.respond_to?(:reloadable?) class << base define_method(:reloadable?) { true } end |