diff options
author | Marc Chung <mchung@gmail.com> | 2011-11-22 17:04:19 -0700 |
---|---|---|
committer | Marc Chung <mchung@gmail.com> | 2011-11-22 17:04:19 -0700 |
commit | 745b7a14377607c5fddb8cd1151d69267095242c (patch) | |
tree | fe0547be8eb45d1ad03234304c91307ce95c85a3 /actionpack | |
parent | 5c61b7230eaa316ce64f4031234b425c35668988 (diff) | |
download | rails-745b7a14377607c5fddb8cd1151d69267095242c.tar.gz rails-745b7a14377607c5fddb8cd1151d69267095242c.tar.bz2 rails-745b7a14377607c5fddb8cd1151d69267095242c.zip |
- Avoid using .first since it will create an additional query.
- Handle scenario where @posts is empty.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/helpers/atom_feed_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/atom_feed_helper.rb b/actionpack/lib/action_view/helpers/atom_feed_helper.rb index 39c37b25dc..73824dc1f8 100644 --- a/actionpack/lib/action_view/helpers/atom_feed_helper.rb +++ b/actionpack/lib/action_view/helpers/atom_feed_helper.rb @@ -32,7 +32,7 @@ module ActionView # app/views/posts/index.atom.builder: # atom_feed do |feed| # feed.title("My great blog!") - # feed.updated(@posts.first.created_at) + # feed.updated(@posts[0].created_at) if @posts.length > 0 # # @posts.each do |post| # feed.entry(post) do |entry| |