mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
This commit is contained in:
parent
ad9cabd77c
commit
62aa0603b7
2 changed files with 5 additions and 1 deletions
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue