Skip to content

Loading…

Prefer 'each' instead of 'for in' #1137

Merged
merged 1 commit into from

2 participants

@guilleiguaran
Ruby on Rails member

Little change in activemodel/lib/active_model/observing.rb

@josevalim josevalim merged commit 95bd199 into rails:master
@jake3030 jake3030 pushed a commit to jake3030/rails that referenced this pull request
@roidrage roidrage Fixed plugin generator so that generated unit tests would subclass Ac…
…tiveSupport::TestCase, also introduced a helper script to reduce the needed require statements. [#1137 state:committed]

Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
7418d36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 19, 2011
  1. @guilleiguaran
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 3 deletions.
  1. +1 −3 activemodel/lib/active_model/observing.rb
View
4 activemodel/lib/active_model/observing.rb
@@ -71,9 +71,7 @@ def add_observer(observer)
# Notify list of observers of a change.
def notify_observers(*arg)
- for observer in observer_instances
- observer.update(*arg)
- end
+ observer_instances.each { |observer| observer.update(*arg) }
end
# Total number of observers.
Something went wrong with that request. Please try again.