aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-09-25 08:50:47 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-09-25 08:50:47 +0000
commit6720efb8e33bb45d502cafc4d84da1ff9a5b5eeb (patch)
tree2da1a8b2667a2bbfd1a08f25d6073c5d4c785a0f
parent7f86e026f6411d3a557831efbb1af121e791eb31 (diff)
downloadrails-6720efb8e33bb45d502cafc4d84da1ff9a5b5eeb.tar.gz
rails-6720efb8e33bb45d502cafc4d84da1ff9a5b5eeb.tar.bz2
rails-6720efb8e33bb45d502cafc4d84da1ff9a5b5eeb.zip
Use assignment instead of call
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2329 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--activerecord/lib/active_record/observer.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/observer.rb b/activerecord/lib/active_record/observer.rb
index 1a167667e3..62626e1852 100644
--- a/activerecord/lib/active_record/observer.rb
+++ b/activerecord/lib/active_record/observer.rb
@@ -19,13 +19,11 @@ module ActiveRecord
# # 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