Skip to content
This repository
Browse code

Improve examples: use each instead of for...in

  • Loading branch information...
commit de6660b5ec4aa8c0e2415f3483aa9346ef8c9223 1 parent e851e9e
Gabe Berke-Williams authored August 31, 2011
2  actionpack/lib/action_view/base.rb
@@ -116,7 +116,7 @@ module ActionView #:nodoc:
116 116
   #       xml.language "en-us"
117 117
   #       xml.ttl "40"
118 118
   #
119  
-  #       for item in @recent_items
  119
+  #       @recent_items.each do |item|
120 120
   #         xml.item do
121 121
   #           xml.title(item_title(item))
122 122
   #           xml.description(item_description(item)) if item_description(item)
2  activerecord/lib/active_record/fixtures.rb
@@ -126,7 +126,7 @@ class FixturesFileNotFound < StandardError; end
126 126
 # Some times you don't care about the content of the fixtures as much as you care about the volume. In these cases, you can
127 127
 # mix ERB in with your YAML fixtures to create a bunch of fixtures for load testing, like:
128 128
 #
129  
-#   <% for i in 1..1000 %>
  129
+#   <% (1..1000).each do |i| %>
130 130
 #   fix_<%= i %>:
131 131
 #     id: <%= i %>
132 132
 #     name: guy_<%= 1 %>

0 notes on commit de6660b

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