Skip to content
Browse files

Use assignment instead of call

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2329 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 7f86e02 commit 6720efb8e33bb45d502cafc4d84da1ff9a5b5eeb @dhh dhh committed Sep 25, 2005
Showing with 1 addition and 3 deletions.
  1. +1 −3 activerecord/lib/active_record/observer.rb
View
4 activerecord/lib/active_record/observer.rb
@@ -19,13 +19,11 @@ module ClassMethods
# # Same as above, just using explicit class references
# ActiveRecord::Base.observers = Cacher, GarbageCollector
def observers=(*observers)
- observers = [ observers ].flatten.collect do |observer|
+ observers = [ observers ].flatten.each do |observer|
observer.is_a?(Symbol) ?
observer.to_s.camelize.constantize.instance :
observer.instance
end
-
- observers.size > 1 ? observers : observers.first
end
end
end

0 comments on commit 6720efb

Please sign in to comment.
Something went wrong with that request. Please try again.