aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/debugging_rails_applications.textile
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2011-07-08 06:05:48 +0900
committerAkira Matsuda <ronnie@dio.jp>2011-07-08 06:13:21 +0900
commit4d4819fb279386570466b2f99254cd77fb71e05c (patch)
tree015c2dff8517520e26476f4564ea7e2c2feba816 /railties/guides/source/debugging_rails_applications.textile
parentb2816ae97173839176ccb982b3dc48854f1fc280 (diff)
downloadrails-4d4819fb279386570466b2f99254cd77fb71e05c.tar.gz
rails-4d4819fb279386570466b2f99254cd77fb71e05c.tar.bz2
rails-4d4819fb279386570466b2f99254cd77fb71e05c.zip
:conditions => where
Diffstat (limited to 'railties/guides/source/debugging_rails_applications.textile')
-rw-r--r--railties/guides/source/debugging_rails_applications.textile17
1 files changed, 5 insertions, 12 deletions
diff --git a/railties/guides/source/debugging_rails_applications.textile b/railties/guides/source/debugging_rails_applications.textile
index 6f028805d6..500ebf8f7a 100644
--- a/railties/guides/source/debugging_rails_applications.textile
+++ b/railties/guides/source/debugging_rails_applications.textile
@@ -480,11 +480,7 @@ class Author < ActiveRecord::Base
def find_recent_comments(limit = 10)
debugger
- @recent_comments ||= comments.find(
- :all,
- :conditions => ["created_at > ?", 1.week.ago],
- :limit => limit
- )
+ @recent_comments ||= comments.where("created_at > ?", 1.week.ago).limit(limit)
end
end
</ruby>
@@ -509,13 +505,10 @@ With the code stopped, take a look around:
(rdb:1) list
[6, 15] in /PathTo/project/app/models/author.rb
6 debugger
- 7 @recent_comments ||= comments.find(
- 8 :all,
- 9 :conditions => ["created_at > ?", 1.week.ago],
- 10 :limit => limit
-=> 11 )
- 12 end
- 13 end
+=> 7 @recent_comments ||= comments.where("created_at > ?", 1.week.ago).limit(limit)
+ 8 end
+ 9 end
+ 10 ...
</shell>
You are at the end of the line, but... was this line executed? You can inspect the instance variables.