Permalink
Browse files

removes unnecessary assignment and local variable in AR::Base#subclas…

…ses, and revises its rdoc
  • Loading branch information...
1 parent c88b933 commit 0e274639b495c358598bcc8d9ebbefceadd6045e @fxn fxn committed Apr 13, 2010
Showing with 2 additions and 3 deletions.
  1. +2 −3 activerecord/lib/active_record/base.rb
@@ -1275,11 +1275,10 @@ def with_exclusive_scope(method_scoping = {}, &block)
with_scope(method_scoping, :overwrite, &block)
end
- # ActiveRecord::Base utilizes the inherited hook to know about new subclasses.
- # You can access the list of currently loaded ActiveRecord::Base subclasses using this accessor.
+ # Returns a list of all subclasses of this class, meaning all descendants.
def subclasses
@@subclasses[self] ||= []
- @@subclasses[self] + extra = @@subclasses[self].inject([]) {|list, subclass| list + subclass.subclasses }
+ @@subclasses[self] + @@subclasses[self].inject([]) {|list, subclass| list + subclass.subclasses }
end
public :subclasses

0 comments on commit 0e27463

Please sign in to comment.