activerecord 2.0.2 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activerecord might be problematic. Click here for more details.

Files changed (53) hide show
  1. data/CHANGELOG +25 -0
  2. data/README +0 -0
  3. data/Rakefile +5 -3
  4. data/lib/active_record.rb +0 -0
  5. data/lib/active_record/associations.rb +232 -193
  6. data/lib/active_record/associations/has_and_belongs_to_many_association.rb +14 -14
  7. data/lib/active_record/associations/has_many_association.rb +2 -2
  8. data/lib/active_record/associations/has_many_through_association.rb +25 -6
  9. data/lib/active_record/attribute_methods.rb +4 -3
  10. data/lib/active_record/base.rb +75 -41
  11. data/lib/active_record/calculations.rb +2 -1
  12. data/lib/active_record/callbacks.rb +0 -0
  13. data/lib/active_record/connection_adapters/abstract/connection_specification.rb +1 -1
  14. data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +8 -6
  15. data/lib/active_record/connection_adapters/abstract/schema_statements.rb +12 -11
  16. data/lib/active_record/connection_adapters/abstract_adapter.rb +1 -0
  17. data/lib/active_record/connection_adapters/mysql_adapter.rb +0 -0
  18. data/lib/active_record/connection_adapters/postgresql_adapter.rb +3 -3
  19. data/lib/active_record/connection_adapters/sqlite_adapter.rb +13 -6
  20. data/lib/active_record/fixtures.rb +29 -31
  21. data/lib/active_record/migration.rb +4 -5
  22. data/lib/active_record/observer.rb +1 -1
  23. data/lib/active_record/transactions.rb +3 -5
  24. data/lib/active_record/validations.rb +5 -3
  25. data/lib/active_record/version.rb +1 -1
  26. data/test/abstract_unit.rb +0 -0
  27. data/test/active_schema_test_mysql.rb +5 -2
  28. data/test/adapter_test.rb +1 -0
  29. data/test/all.sh +0 -0
  30. data/test/associations/callbacks_test.rb +1 -1
  31. data/test/associations/eager_test.rb +5 -0
  32. data/test/associations/join_model_test.rb +11 -3
  33. data/test/associations_test.rb +36 -6
  34. data/test/attribute_methods_test.rb +0 -0
  35. data/test/base_test.rb +92 -10
  36. data/test/calculations_test.rb +9 -1
  37. data/test/debug.log +358 -0
  38. data/test/deprecated_finder_test.rb +0 -0
  39. data/test/fixtures/author.rb +1 -1
  40. data/test/fixtures/company.rb +0 -0
  41. data/test/fixtures/fixture_database.sqlite3 +0 -0
  42. data/test/fixtures/fixture_database_2.sqlite3 +0 -0
  43. data/test/fixtures/reply.rb +0 -0
  44. data/test/fixtures/topic.rb +0 -0
  45. data/test/fixtures_test.rb +20 -12
  46. data/test/inheritance_test.rb +0 -0
  47. data/test/lifecycle_test.rb +0 -0
  48. data/test/migration_test.rb +46 -0
  49. data/test/query_cache_test.rb +22 -2
  50. data/test/readonly_test.rb +0 -0
  51. data/test/unconnected_test.rb +0 -0
  52. data/test/validations_test.rb +50 -38
  53. metadata +8 -4
@@ -115,6 +115,11 @@ class EagerAssociationTest < Test::Unit::TestCase
115
115
  assert_equal [2], posts.collect { |p| p.id }
116
116
  end
117
117
 
118
+ def test_eager_association_loading_with_belongs_to_inferred_foreign_key_from_association_name
119
+ author_favorite = AuthorFavorite.find(:first, :include => :favorite_author)
120
+ assert_equal authors(:mary), assert_no_queries { author_favorite.favorite_author }
121
+ end
122
+
118
123
  def test_eager_association_loading_with_explicit_join
119
124
  posts = Post.find(:all, :include => :comments, :joins => "INNER JOIN authors ON posts.author_id = authors.id AND authors.name = 'Mary'", :limit => 1, :order => 'author_id')
120
125
  assert_equal 1, posts.length
@@ -304,7 +304,7 @@ class AssociationsJoinModelTest < Test::Unit::TestCase
304
304
  end
305
305
 
306
306
  def test_unavailable_through_reflection
307
- assert_raises (ActiveRecord::HasManyThroughAssociationNotFoundError) { authors(:david).nothings }
307
+ assert_raise(ActiveRecord::HasManyThroughAssociationNotFoundError) { authors(:david).nothings }
308
308
  end
309
309
 
310
310
  def test_has_many_through_join_model_with_conditions
@@ -313,10 +313,10 @@ class AssociationsJoinModelTest < Test::Unit::TestCase
313
313
  end
314
314
 
315
315
  def test_has_many_polymorphic
316
- assert_raises ActiveRecord::HasManyThroughAssociationPolymorphicError do
316
+ assert_raise ActiveRecord::HasManyThroughAssociationPolymorphicError do
317
317
  assert_equal posts(:welcome, :thinking), tags(:general).taggables
318
318
  end
319
- assert_raises ActiveRecord::EagerLoadPolymorphicError do
319
+ assert_raise ActiveRecord::EagerLoadPolymorphicError do
320
320
  assert_equal posts(:welcome, :thinking), tags(:general).taggings.find(:all, :include => :taggable)
321
321
  end
322
322
  end
@@ -536,6 +536,14 @@ class AssociationsJoinModelTest < Test::Unit::TestCase
536
536
  assert_nothing_raised { authors(:david).comments.sum(:post_id) }
537
537
  end
538
538
 
539
+ def test_calculations_on_has_many_through_should_disambiguate_fields
540
+ assert_nothing_raised { authors(:david).categories.maximum(:id) }
541
+ end
542
+
543
+ def test_calculations_on_has_many_through_should_not_disambiguate_fields_unless_necessary
544
+ assert_nothing_raised { authors(:david).categories.maximum("categories.id") }
545
+ end
546
+
539
547
  def test_has_many_through_has_many_with_sti
540
548
  assert_equal [comments(:does_it_hurt)], authors(:david).special_post_comments
541
549
  end
@@ -72,23 +72,23 @@ class AssociationsTest < Test::Unit::TestCase
72
72
  end
73
73
  end
74
74
  end
75
-
75
+
76
76
  class AssociationProxyTest < Test::Unit::TestCase
77
77
  fixtures :authors, :posts, :categorizations, :categories, :developers, :projects, :developers_projects
78
-
78
+
79
79
  def test_proxy_accessors
80
80
  welcome = posts(:welcome)
81
81
  assert_equal welcome, welcome.author.proxy_owner
82
82
  assert_equal welcome.class.reflect_on_association(:author), welcome.author.proxy_reflection
83
83
  welcome.author.class # force load target
84
84
  assert_equal welcome.author, welcome.author.proxy_target
85
-
85
+
86
86
  david = authors(:david)
87
87
  assert_equal david, david.posts.proxy_owner
88
88
  assert_equal david.class.reflect_on_association(:posts), david.posts.proxy_reflection
89
89
  david.posts.first # force load target
90
90
  assert_equal david.posts, david.posts.proxy_target
91
-
91
+
92
92
  assert_equal david, david.posts_with_extension.testing_proxy_owner
93
93
  assert_equal david.class.reflect_on_association(:posts_with_extension), david.posts_with_extension.testing_proxy_reflection
94
94
  david.posts_with_extension.first # force load target
@@ -98,10 +98,28 @@ class AssociationProxyTest < Test::Unit::TestCase
98
98
  def test_push_does_not_load_target
99
99
  david = authors(:david)
100
100
 
101
+ david.posts << (post = Post.new(:title => "New on Edge", :body => "More cool stuff!"))
102
+ assert !david.posts.loaded?
103
+ assert david.posts.include?(post)
104
+ end
105
+
106
+ def test_push_has_many_through_does_not_load_target
107
+ david = authors(:david)
108
+
101
109
  david.categories << categories(:technology)
102
110
  assert !david.categories.loaded?
103
111
  assert david.categories.include?(categories(:technology))
104
112
  end
113
+
114
+ def test_push_followed_by_save_does_not_load_target
115
+ david = authors(:david)
116
+
117
+ david.posts << (post = Post.new(:title => "New on Edge", :body => "More cool stuff!"))
118
+ assert !david.posts.loaded?
119
+ david.save
120
+ assert !david.posts.loaded?
121
+ assert david.posts.include?(post)
122
+ end
105
123
 
106
124
  def test_push_does_not_lose_additions_to_new_record
107
125
  josh = Author.new(:name => "Josh")
@@ -772,7 +790,13 @@ class HasManyAssociationsTest < Test::Unit::TestCase
772
790
  assert companies(:first_firm).save
773
791
  assert_equal 3, companies(:first_firm).clients_of_firm(true).size
774
792
  end
775
-
793
+
794
+ def test_build_followed_by_save_does_not_load_target
795
+ new_client = companies(:first_firm).clients_of_firm.build("name" => "Another Client")
796
+ assert companies(:first_firm).save
797
+ assert !companies(:first_firm).clients_of_firm.loaded?
798
+ end
799
+
776
800
  def test_build_without_loading_association
777
801
  first_topic = topics(:first)
778
802
  Reply.column_names
@@ -825,6 +849,12 @@ class HasManyAssociationsTest < Test::Unit::TestCase
825
849
  assert_equal 3, companies(:first_firm).clients_of_firm(true).size
826
850
  end
827
851
 
852
+ def test_create_followed_by_save_does_not_load_target
853
+ new_client = companies(:first_firm).clients_of_firm.create("name" => "Another Client")
854
+ assert companies(:first_firm).save
855
+ assert !companies(:first_firm).clients_of_firm.loaded?
856
+ end
857
+
828
858
  def test_find_or_initialize
829
859
  the_client = companies(:first_firm).clients.find_or_initialize_by_name("Yet another client")
830
860
  assert_equal companies(:first_firm).id, the_client.firm_id
@@ -2033,7 +2063,7 @@ class HasAndBelongsToManyAssociationsTest < Test::Unit::TestCase
2033
2063
  end
2034
2064
 
2035
2065
  def test_get_ids
2036
- assert_equal projects(:active_record, :action_controller).map(&:id), developers(:david).project_ids
2066
+ assert_equal projects(:active_record, :action_controller).map(&:id).sort, developers(:david).project_ids.sort
2037
2067
  assert_equal [projects(:active_record).id], developers(:jamis).project_ids
2038
2068
  end
2039
2069
 
File without changes
@@ -596,6 +596,13 @@ class BasicsTest < Test::Unit::TestCase
596
596
  end
597
597
  end
598
598
 
599
+ def test_update_all_ignores_order_limit_from_association
600
+ author = Author.find(1)
601
+ assert_nothing_raised do
602
+ assert_equal author.posts_with_comments_and_categories.length, author.posts_with_comments_and_categories.update_all("body = 'bulk update!'")
603
+ end
604
+ end
605
+
599
606
  def test_update_many
600
607
  topic_data = { 1 => { "content" => "1 updated" }, 2 => { "content" => "2 updated" } }
601
608
  updated = Topic.update(topic_data.keys, topic_data.values)
@@ -1275,6 +1282,15 @@ class BasicsTest < Test::Unit::TestCase
1275
1282
  assert_equal 1, topics(:first).parent_id
1276
1283
  end
1277
1284
 
1285
+ def test_increment_attribute_by
1286
+ assert_equal 50, accounts(:signals37).credit_limit
1287
+ accounts(:signals37).increment! :credit_limit, 5
1288
+ assert_equal 55, accounts(:signals37, :reload).credit_limit
1289
+
1290
+ accounts(:signals37).increment(:credit_limit, 1).increment!(:credit_limit, 3)
1291
+ assert_equal 59, accounts(:signals37, :reload).credit_limit
1292
+ end
1293
+
1278
1294
  def test_decrement_attribute
1279
1295
  assert_equal 50, accounts(:signals37).credit_limit
1280
1296
 
@@ -1285,6 +1301,15 @@ class BasicsTest < Test::Unit::TestCase
1285
1301
  assert_equal 47, accounts(:signals37, :reload).credit_limit
1286
1302
  end
1287
1303
 
1304
+ def test_decrement_attribute_by
1305
+ assert_equal 50, accounts(:signals37).credit_limit
1306
+ accounts(:signals37).decrement! :credit_limit, 5
1307
+ assert_equal 45, accounts(:signals37, :reload).credit_limit
1308
+
1309
+ accounts(:signals37).decrement(:credit_limit, 1).decrement!(:credit_limit, 3)
1310
+ assert_equal 41, accounts(:signals37, :reload).credit_limit
1311
+ end
1312
+
1288
1313
  def test_toggle_attribute
1289
1314
  assert !topics(:first).approved?
1290
1315
  topics(:first).toggle!(:approved)
@@ -1681,20 +1706,24 @@ class BasicsTest < Test::Unit::TestCase
1681
1706
  end
1682
1707
 
1683
1708
  def test_except_attributes
1684
- assert_equal(
1685
- %w( author_name type id approved replies_count bonus_time written_on content author_email_address parent_id last_read),
1686
- topics(:first).attributes(:except => :title).keys
1687
- )
1709
+ assert_deprecated do
1710
+ assert_equal(
1711
+ %w( author_name type id approved replies_count bonus_time written_on content author_email_address parent_id last_read),
1712
+ topics(:first).attributes(:except => :title).keys
1713
+ )
1688
1714
 
1689
- assert_equal(
1690
- %w( replies_count bonus_time written_on content author_email_address parent_id last_read),
1691
- topics(:first).attributes(:except => [ :title, :id, :type, :approved, :author_name ]).keys
1692
- )
1715
+ assert_equal(
1716
+ %w( replies_count bonus_time written_on content author_email_address parent_id last_read),
1717
+ topics(:first).attributes(:except => [ :title, :id, :type, :approved, :author_name ]).keys
1718
+ )
1719
+ end
1693
1720
  end
1694
1721
 
1695
1722
  def test_include_attributes
1696
- assert_equal(%w( title ), topics(:first).attributes(:only => :title).keys)
1697
- assert_equal(%w( title author_name type id approved ), topics(:first).attributes(:only => [ :title, :id, :type, :approved, :author_name ]).keys)
1723
+ assert_deprecated do
1724
+ assert_equal(%w( title ), topics(:first).attributes(:only => :title).keys)
1725
+ assert_equal(%w( title author_name type id approved ), topics(:first).attributes(:only => [ :title, :id, :type, :approved, :author_name ]).keys)
1726
+ end
1698
1727
  end
1699
1728
 
1700
1729
  def test_type_name_with_module_should_handle_beginning
@@ -1742,4 +1771,57 @@ class BasicsTest < Test::Unit::TestCase
1742
1771
  assert_kind_of Reply, topics(:first).becomes(Reply)
1743
1772
  assert_equal "The First Topic", topics(:first).becomes(Reply).title
1744
1773
  end
1774
+
1775
+ def test_silence_sets_log_level_to_error_in_block
1776
+ original_logger = ActiveRecord::Base.logger
1777
+ log = StringIO.new
1778
+ ActiveRecord::Base.logger = Logger.new(log)
1779
+ ActiveRecord::Base.logger.level = Logger::DEBUG
1780
+ ActiveRecord::Base.silence do
1781
+ ActiveRecord::Base.logger.warn "warn"
1782
+ ActiveRecord::Base.logger.error "error"
1783
+ end
1784
+ assert_equal "error\n", log.string
1785
+ ensure
1786
+ ActiveRecord::Base.logger = original_logger
1787
+ end
1788
+
1789
+ def test_silence_sets_log_level_back_to_level_before_yield
1790
+ original_logger = ActiveRecord::Base.logger
1791
+ log = StringIO.new
1792
+ ActiveRecord::Base.logger = Logger.new(log)
1793
+ ActiveRecord::Base.logger.level = Logger::WARN
1794
+ ActiveRecord::Base.silence do
1795
+ end
1796
+ assert_equal Logger::WARN, ActiveRecord::Base.logger.level
1797
+ ensure
1798
+ ActiveRecord::Base.logger = original_logger
1799
+ end
1800
+
1801
+ def test_benchmark_with_log_level
1802
+ original_logger = ActiveRecord::Base.logger
1803
+ log = StringIO.new
1804
+ ActiveRecord::Base.logger = Logger.new(log)
1805
+ ActiveRecord::Base.logger.level = Logger::WARN
1806
+ ActiveRecord::Base.benchmark("Debug Topic Count", Logger::DEBUG) { Topic.count }
1807
+ ActiveRecord::Base.benchmark("Warn Topic Count", Logger::WARN) { Topic.count }
1808
+ ActiveRecord::Base.benchmark("Error Topic Count", Logger::ERROR) { Topic.count }
1809
+ assert_no_match /Debug Topic Count/, log.string
1810
+ assert_match /Warn Topic Count/, log.string
1811
+ assert_match /Error Topic Count/, log.string
1812
+ ensure
1813
+ ActiveRecord::Base.logger = original_logger
1814
+ end
1815
+
1816
+ def test_benchmark_with_use_silence
1817
+ original_logger = ActiveRecord::Base.logger
1818
+ log = StringIO.new
1819
+ ActiveRecord::Base.logger = Logger.new(log)
1820
+ ActiveRecord::Base.benchmark("Logging", Logger::DEBUG, true) { ActiveRecord::Base.logger.debug "Loud" }
1821
+ ActiveRecord::Base.benchmark("Logging", Logger::DEBUG, false) { ActiveRecord::Base.logger.debug "Quiet" }
1822
+ assert_no_match /Loud/, log.string
1823
+ assert_match /Quiet/, log.string
1824
+ ensure
1825
+ ActiveRecord::Base.logger = original_logger
1826
+ end
1745
1827
  end
@@ -159,7 +159,15 @@ class CalculationsTest < Test::Unit::TestCase
159
159
  assert_equal 1, c.first.last
160
160
  end
161
161
  end
162
-
162
+
163
+ def test_should_calculate_grouped_association_with_foreign_key_option
164
+ Account.belongs_to :another_firm, :class_name => 'Firm', :foreign_key => 'firm_id'
165
+ c = Account.count(:all, :group => :another_firm)
166
+ assert_equal 1, c[companies(:first_firm)]
167
+ assert_equal 2, c[companies(:rails_core)]
168
+ assert_equal 1, c[companies(:first_client)]
169
+ end
170
+
163
171
  def test_should_not_modify_options_when_using_includes
164
172
  options = {:conditions => 'companies.id > 1', :include => :firm}
165
173
  options_copy = options.dup
@@ -0,0 +1,358 @@
1
+ # Logfile created on Wed Apr 30 00:19:12 -0500 2008 by /
2
+ Unable to load post, underlying cause no such file to load -- post.rb
3
+
4
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_without_new_constant_marking'
5
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_file'
6
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
7
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:202:in `load_file'
8
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:94:in `require_or_load'
9
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:60:in `depend_on'
10
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:442:in `require_dependency'
11
+ ./cases/../../lib/active_record/fixtures.rb:854:in `try_to_load_dependency'
12
+ ./cases/../../lib/active_record/fixtures.rb:869:in `require_fixture_classes'
13
+ ./cases/../../lib/active_record/fixtures.rb:866:in `each'
14
+ ./cases/../../lib/active_record/fixtures.rb:866:in `require_fixture_classes'
15
+ ./cases/../../lib/active_record/fixtures.rb:849:in `fixtures'
16
+ cases/named_scope_test.rb:9
17
+ Unable to load author, underlying cause no such file to load -- author.rb
18
+
19
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_without_new_constant_marking'
20
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_file'
21
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
22
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:202:in `load_file'
23
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:94:in `require_or_load'
24
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:60:in `depend_on'
25
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:442:in `require_dependency'
26
+ ./cases/../../lib/active_record/fixtures.rb:854:in `try_to_load_dependency'
27
+ ./cases/../../lib/active_record/fixtures.rb:869:in `require_fixture_classes'
28
+ ./cases/../../lib/active_record/fixtures.rb:866:in `each'
29
+ ./cases/../../lib/active_record/fixtures.rb:866:in `require_fixture_classes'
30
+ ./cases/../../lib/active_record/fixtures.rb:849:in `fixtures'
31
+ cases/named_scope_test.rb:9
32
+ Unable to load topic, underlying cause no such file to load -- topic.rb
33
+
34
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_without_new_constant_marking'
35
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_file'
36
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
37
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:202:in `load_file'
38
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:94:in `require_or_load'
39
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:60:in `depend_on'
40
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:442:in `require_dependency'
41
+ ./cases/../../lib/active_record/fixtures.rb:854:in `try_to_load_dependency'
42
+ ./cases/../../lib/active_record/fixtures.rb:869:in `require_fixture_classes'
43
+ ./cases/../../lib/active_record/fixtures.rb:866:in `each'
44
+ ./cases/../../lib/active_record/fixtures.rb:866:in `require_fixture_classes'
45
+ ./cases/../../lib/active_record/fixtures.rb:849:in `fixtures'
46
+ cases/named_scope_test.rb:9
47
+ Topic Load (0.001909) SELECT * FROM "topics" 
48
+ Topic Load (0.001633) SELECT * FROM "topics" 
49
+ Topic Load (0.001143) SELECT * FROM "topics" 
50
+ Topic Load (0.001296) SELECT * FROM "topics" WHERE (content LIKE '%Have%') 
51
+ Topic Load (0.000764) SELECT * FROM "topics" WHERE (content LIKE '%Have%') 
52
+ Topic Load (0.000731) SELECT * FROM "topics" WHERE (content LIKE '%Have%') 
53
+ Topic Load (0.001061) SELECT * FROM "topics" 
54
+ Topic Load (0.000981) SELECT * FROM "topics" 
55
+ Topic Load (0.000870) SELECT * FROM "topics" 
56
+ Topic Load (0.000915) SELECT * FROM "topics" 
57
+ Author Load (0.000274) SELECT * FROM "authors" WHERE ("authors"."id" = 1) 
58
+ Post Load (0.000496) SELECT * FROM "posts" WHERE (body LIKE '%a%') 
59
+ Post Load (0.001247) SELECT * FROM "posts" WHERE ("posts".author_id = 1) 
60
+ Post Load (0.001080) SELECT * FROM "posts" WHERE (body LIKE '%a%') 
61
+ Post Load (0.000536) SELECT * FROM "posts" WHERE (body LIKE '%a%') 
62
+ Post Load (0.000406) SELECT * FROM "posts" WHERE ("posts".author_id = 1) AND (body LIKE '%a%') 
63
+ Author Load (0.000252) SELECT * FROM "authors" WHERE ("authors"."id" = 1) 
64
+ Comment Load (0.000797) SELECT * FROM "comments" WHERE (comments.body LIKE '%e%') 
65
+ Post Load (0.000699) SELECT * FROM "posts" WHERE ("posts".author_id = 1) 
66
+ Comment Load (0.000772) SELECT * FROM "comments" WHERE (comments.body LIKE '%e%') 
67
+ Comment Load (0.000879) SELECT "comments".* FROM "comments" INNER JOIN posts ON comments.post_id = posts.id WHERE (("posts".author_id = 1)) 
68
+ Comment Load (0.000840) SELECT * FROM "comments" WHERE (comments.body LIKE '%e%') 
69
+ Comment Load (0.000837) SELECT "comments".* FROM "comments" INNER JOIN posts ON comments.post_id = posts.id WHERE (("posts".author_id = 1)) AND (comments.body LIKE '%e%') 
70
+ Topic Load (0.000850) SELECT * FROM "topics" 
71
+ Topic Load (0.001908) SELECT * FROM "topics" 
72
+ Topic Load (0.001432) SELECT * FROM "topics" 
73
+ Topic Load (0.000777) SELECT * FROM "topics" 
74
+ Topic Load (0.000772) SELECT * FROM "topics" 
75
+ Topic Load (0.000318) SELECT * FROM "topics" LIMIT 1
76
+ Topic Load (0.000765) SELECT * FROM "topics" 
77
+ Topic Load (0.000772) SELECT * FROM "topics" 
78
+ Topic Load (0.000772) SELECT * FROM "topics" 
79
+ Topic Load (0.000361) SELECT * FROM "topics" WHERE ("topics"."id" = 3) 
80
+ Topic Load (0.000511) SELECT * FROM "topics" WHERE (written_on < '2005-07-15 09:28:00') 
81
+ Topic Load (0.000320) SELECT * FROM "topics" WHERE ("topics"."id" = 2) 
82
+ Topic Load (0.000462) SELECT * FROM "topics" WHERE (written_on < '2004-07-15 09:28:00') 
83
+ Topic Load (0.000516) SELECT * FROM "topics" WHERE (written_on < '2005-07-15 09:28:00') 
84
+ Topic Load (0.000343) SELECT * FROM "topics" WHERE (written_on < '2004-07-15 09:28:00') 
85
+ Topic Load (0.000821) SELECT * FROM "topics" 
86
+ Topic Create (0.000381) INSERT INTO "topics" ("title", "author_name", "type", "approved", "bonus_time", "replies_count", "author_email_address", "written_on", "content", "last_read", "parent_id") VALUES(NULL, NULL, NULL, 't', NULL, 0, 'test@test.com', '2008-04-30 00:19:13', NULL, NULL, NULL)
87
+ Topic Load (0.001058) SELECT * FROM "topics" WHERE ("topics"."approved" = 't') 
88
+ Topic Load (0.000950) SELECT * FROM "topics" WHERE ("topics"."approved" = 't') 
89
+ Topic Load (0.000643) SELECT * FROM "topics" WHERE (replies_count > 0) 
90
+ Topic Load (0.000608) SELECT * FROM "topics" WHERE (replies_count > 0) 
91
+ Topic Load (0.000552) SELECT * FROM "topics" WHERE ((replies_count > 0) AND ("topics"."approved" = 't')) 
92
+ Topic Load (0.000920) SELECT * FROM "topics" WHERE ("topics"."approved" = 't') 
93
+ Topic Load (0.000812) SELECT * FROM "topics" WHERE ("topics"."approved" = 't') 
94
+ Topic Load (0.000806) SELECT * FROM "topics" WHERE ("topics"."approved" = 't') 
95
+ SQL (0.000204) SELECT count(*) AS count_all FROM "topics" WHERE ("topics"."approved" = 't') 
96
+ SQL (0.000176) SELECT count(*) AS count_all FROM "topics" WHERE ("topics"."approved" = 't') 
97
+ Unable to load post, underlying cause no such file to load -- post.rb
98
+
99
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_without_new_constant_marking'
100
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_file'
101
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
102
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:202:in `load_file'
103
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:94:in `require_or_load'
104
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:60:in `depend_on'
105
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:442:in `require_dependency'
106
+ ./cases/../../lib/active_record/fixtures.rb:854:in `try_to_load_dependency'
107
+ ./cases/../../lib/active_record/fixtures.rb:869:in `require_fixture_classes'
108
+ ./cases/../../lib/active_record/fixtures.rb:866:in `each'
109
+ ./cases/../../lib/active_record/fixtures.rb:866:in `require_fixture_classes'
110
+ ./cases/../../lib/active_record/fixtures.rb:849:in `fixtures'
111
+ cases/named_scope_test.rb:11
112
+ Unable to load author, underlying cause no such file to load -- author.rb
113
+
114
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_without_new_constant_marking'
115
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_file'
116
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
117
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:202:in `load_file'
118
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:94:in `require_or_load'
119
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:60:in `depend_on'
120
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:442:in `require_dependency'
121
+ ./cases/../../lib/active_record/fixtures.rb:854:in `try_to_load_dependency'
122
+ ./cases/../../lib/active_record/fixtures.rb:869:in `require_fixture_classes'
123
+ ./cases/../../lib/active_record/fixtures.rb:866:in `each'
124
+ ./cases/../../lib/active_record/fixtures.rb:866:in `require_fixture_classes'
125
+ ./cases/../../lib/active_record/fixtures.rb:849:in `fixtures'
126
+ cases/named_scope_test.rb:11
127
+ Unable to load topic, underlying cause no such file to load -- topic.rb
128
+
129
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_without_new_constant_marking'
130
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_file'
131
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
132
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:202:in `load_file'
133
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:94:in `require_or_load'
134
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:60:in `depend_on'
135
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:442:in `require_dependency'
136
+ ./cases/../../lib/active_record/fixtures.rb:854:in `try_to_load_dependency'
137
+ ./cases/../../lib/active_record/fixtures.rb:869:in `require_fixture_classes'
138
+ ./cases/../../lib/active_record/fixtures.rb:866:in `each'
139
+ ./cases/../../lib/active_record/fixtures.rb:866:in `require_fixture_classes'
140
+ ./cases/../../lib/active_record/fixtures.rb:849:in `fixtures'
141
+ cases/named_scope_test.rb:11
142
+ Topic Load (0.001976) SELECT * FROM "topics" 
143
+ Topic Load (0.001593) SELECT * FROM "topics" 
144
+ Topic Load (0.001164) SELECT * FROM "topics" 
145
+ Topic Load (0.000571) SELECT * FROM "topics" LIMIT 1
146
+ Topic Load (0.000448) SELECT * FROM "topics" LIMIT 1
147
+ SQL (0.000197) SELECT count(*) AS count_all FROM "topics" 
148
+ SQL (0.000184) SELECT count(*) AS count_all FROM "topics" 
149
+ SQL (0.000201) SELECT avg("topics".replies_count) AS avg_replies_count FROM "topics" 
150
+ SQL (0.000199) SELECT avg("topics".replies_count) AS avg_replies_count FROM "topics" 
151
+ Unable to load post, underlying cause no such file to load -- post.rb
152
+
153
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_without_new_constant_marking'
154
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_file'
155
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
156
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:202:in `load_file'
157
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:94:in `require_or_load'
158
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:60:in `depend_on'
159
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:442:in `require_dependency'
160
+ ./cases/../../lib/active_record/fixtures.rb:854:in `try_to_load_dependency'
161
+ ./cases/../../lib/active_record/fixtures.rb:869:in `require_fixture_classes'
162
+ ./cases/../../lib/active_record/fixtures.rb:866:in `each'
163
+ ./cases/../../lib/active_record/fixtures.rb:866:in `require_fixture_classes'
164
+ ./cases/../../lib/active_record/fixtures.rb:849:in `fixtures'
165
+ cases/named_scope_test.rb:12
166
+ Unable to load author, underlying cause no such file to load -- author.rb
167
+
168
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_without_new_constant_marking'
169
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_file'
170
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
171
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:202:in `load_file'
172
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:94:in `require_or_load'
173
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:60:in `depend_on'
174
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:442:in `require_dependency'
175
+ ./cases/../../lib/active_record/fixtures.rb:854:in `try_to_load_dependency'
176
+ ./cases/../../lib/active_record/fixtures.rb:869:in `require_fixture_classes'
177
+ ./cases/../../lib/active_record/fixtures.rb:866:in `each'
178
+ ./cases/../../lib/active_record/fixtures.rb:866:in `require_fixture_classes'
179
+ ./cases/../../lib/active_record/fixtures.rb:849:in `fixtures'
180
+ cases/named_scope_test.rb:12
181
+ Unable to load topic, underlying cause no such file to load -- topic.rb
182
+
183
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_without_new_constant_marking'
184
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_file'
185
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
186
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:202:in `load_file'
187
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:94:in `require_or_load'
188
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:60:in `depend_on'
189
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:442:in `require_dependency'
190
+ ./cases/../../lib/active_record/fixtures.rb:854:in `try_to_load_dependency'
191
+ ./cases/../../lib/active_record/fixtures.rb:869:in `require_fixture_classes'
192
+ ./cases/../../lib/active_record/fixtures.rb:866:in `each'
193
+ ./cases/../../lib/active_record/fixtures.rb:866:in `require_fixture_classes'
194
+ ./cases/../../lib/active_record/fixtures.rb:849:in `fixtures'
195
+ cases/named_scope_test.rb:12
196
+ Topic Load (0.002000) SELECT * FROM "topics" 
197
+ Topic Load (0.001548) SELECT * FROM "topics" 
198
+ Topic Load (0.001159) SELECT * FROM "topics" 
199
+ Topic Load (0.000799) SELECT * FROM "topics" WHERE (content LIKE '%Have%') 
200
+ Topic Load (0.000629) SELECT * FROM "topics" WHERE (content LIKE '%Have%') 
201
+ Topic Load (0.000636) SELECT * FROM "topics" WHERE (content LIKE '%Have%') 
202
+ Topic Load (0.001059) SELECT * FROM "topics" 
203
+ Topic Load (0.000874) SELECT * FROM "topics" 
204
+ Topic Load (0.000807) SELECT * FROM "topics" 
205
+ Topic Load (0.000331) SELECT * FROM "topics" LIMIT 1
206
+ Topic Load (0.000317) SELECT * FROM "topics" LIMIT 1
207
+ SQL (0.000145) SELECT count(*) AS count_all FROM "topics" 
208
+ SQL (0.000313) SELECT count(*) AS count_all FROM "topics" 
209
+ SQL (0.000342) SELECT avg("topics".replies_count) AS avg_replies_count FROM "topics" 
210
+ SQL (0.000337) SELECT avg("topics".replies_count) AS avg_replies_count FROM "topics" 
211
+ Topic Load (0.001830) SELECT * FROM "topics" 
212
+ Author Load (0.000249) SELECT * FROM "authors" WHERE ("authors"."id" = 1) 
213
+ Post Load (0.000518) SELECT * FROM "posts" WHERE (body LIKE '%a%') 
214
+ Post Load (0.000703) SELECT * FROM "posts" WHERE ("posts".author_id = 1) 
215
+ Post Load (0.000496) SELECT * FROM "posts" WHERE (body LIKE '%a%') 
216
+ Post Load (0.000500) SELECT * FROM "posts" WHERE (body LIKE '%a%') 
217
+ Post Load (0.000391) SELECT * FROM "posts" WHERE ("posts".author_id = 1) AND (body LIKE '%a%') 
218
+ Author Load (0.000250) SELECT * FROM "authors" WHERE ("authors"."id" = 1) 
219
+ Comment Load (0.000786) SELECT * FROM "comments" WHERE (comments.body LIKE '%e%') 
220
+ Post Load (0.000697) SELECT * FROM "posts" WHERE ("posts".author_id = 1) 
221
+ Comment Load (0.000778) SELECT * FROM "comments" WHERE (comments.body LIKE '%e%') 
222
+ Comment Load (0.000907) SELECT "comments".* FROM "comments" INNER JOIN posts ON comments.post_id = posts.id WHERE (("posts".author_id = 1)) 
223
+ Comment Load (0.000854) SELECT * FROM "comments" WHERE (comments.body LIKE '%e%') 
224
+ Comment Load (0.000825) SELECT "comments".* FROM "comments" INNER JOIN posts ON comments.post_id = posts.id WHERE (("posts".author_id = 1)) AND (comments.body LIKE '%e%') 
225
+ Topic Load (0.000825) SELECT * FROM "topics" 
226
+ Topic Load (0.000783) SELECT * FROM "topics" 
227
+ Topic Load (0.000781) SELECT * FROM "topics" 
228
+ Topic Load (0.000779) SELECT * FROM "topics" 
229
+ Topic Load (0.000796) SELECT * FROM "topics" 
230
+ Topic Load (0.000334) SELECT * FROM "topics" LIMIT 1
231
+ Topic Load (0.000765) SELECT * FROM "topics" 
232
+ Topic Load (0.000769) SELECT * FROM "topics" 
233
+ Topic Load (0.000784) SELECT * FROM "topics" 
234
+ Topic Load (0.000441) SELECT * FROM "topics" WHERE ("topics"."id" = 3) 
235
+ Topic Load (0.000496) SELECT * FROM "topics" WHERE (written_on < '2005-07-15 09:28:00') 
236
+ Topic Load (0.000318) SELECT * FROM "topics" WHERE ("topics"."id" = 2) 
237
+ Topic Load (0.000326) SELECT * FROM "topics" WHERE (written_on < '2004-07-15 09:28:00') 
238
+ Topic Load (0.001103) SELECT * FROM "topics" WHERE (written_on < '2005-07-15 09:28:00') 
239
+ Topic Load (0.000733) SELECT * FROM "topics" WHERE (written_on < '2004-07-15 09:28:00') 
240
+ Topic Load (0.000815) SELECT * FROM "topics" 
241
+ Topic Create (0.000400) INSERT INTO "topics" ("title", "author_name", "type", "approved", "bonus_time", "replies_count", "author_email_address", "written_on", "content", "last_read", "parent_id") VALUES(NULL, NULL, NULL, 't', NULL, 0, 'test@test.com', '2008-04-30 00:24:07', NULL, NULL, NULL)
242
+ Topic Load (0.000920) SELECT * FROM "topics" 
243
+ Topic Load (0.001632) SELECT * FROM "topics" WHERE ("topics"."approved" = 't') 
244
+ Topic Load (0.001510) SELECT * FROM "topics" WHERE ("topics"."approved" = 't') 
245
+ Topic Load (0.000761) SELECT * FROM "topics" WHERE (replies_count > 0) 
246
+ Topic Load (0.000738) SELECT * FROM "topics" WHERE (replies_count > 0) 
247
+ Topic Load (0.000509) SELECT * FROM "topics" WHERE ((replies_count > 0) AND ("topics"."approved" = 't')) 
248
+ Topic Load (0.001035) SELECT * FROM "topics" WHERE ("topics"."approved" = 't') 
249
+ Topic Load (0.000940) SELECT * FROM "topics" WHERE ("topics"."approved" = 't') 
250
+ Topic Load (0.000898) SELECT * FROM "topics" WHERE ("topics"."approved" = 't') 
251
+ SQL (0.000214) SELECT count(*) AS count_all FROM "topics" WHERE ("topics"."approved" = 't') 
252
+ SQL (0.000200) SELECT count(*) AS count_all FROM "topics" WHERE ("topics"."approved" = 't') 
253
+ Reply Load (0.000704) SELECT * FROM "topics" WHERE ( ("topics"."type" = 'Reply' OR "topics"."type" = 'SillyReply' ) ) 
254
+ Reply Load (0.000613) SELECT * FROM "topics" WHERE ( ("topics"."type" = 'Reply' OR "topics"."type" = 'SillyReply' ) ) 
255
+ Unable to load post, underlying cause no such file to load -- post.rb
256
+
257
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_without_new_constant_marking'
258
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_file'
259
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
260
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:202:in `load_file'
261
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:94:in `require_or_load'
262
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:60:in `depend_on'
263
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:442:in `require_dependency'
264
+ ./cases/../../lib/active_record/fixtures.rb:854:in `try_to_load_dependency'
265
+ ./cases/../../lib/active_record/fixtures.rb:869:in `require_fixture_classes'
266
+ ./cases/../../lib/active_record/fixtures.rb:866:in `each'
267
+ ./cases/../../lib/active_record/fixtures.rb:866:in `require_fixture_classes'
268
+ ./cases/../../lib/active_record/fixtures.rb:849:in `fixtures'
269
+ cases/named_scope_test.rb:9
270
+ Unable to load author, underlying cause no such file to load -- author.rb
271
+
272
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_without_new_constant_marking'
273
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_file'
274
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
275
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:202:in `load_file'
276
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:94:in `require_or_load'
277
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:60:in `depend_on'
278
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:442:in `require_dependency'
279
+ ./cases/../../lib/active_record/fixtures.rb:854:in `try_to_load_dependency'
280
+ ./cases/../../lib/active_record/fixtures.rb:869:in `require_fixture_classes'
281
+ ./cases/../../lib/active_record/fixtures.rb:866:in `each'
282
+ ./cases/../../lib/active_record/fixtures.rb:866:in `require_fixture_classes'
283
+ ./cases/../../lib/active_record/fixtures.rb:849:in `fixtures'
284
+ cases/named_scope_test.rb:9
285
+ Unable to load topic, underlying cause no such file to load -- topic.rb
286
+
287
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_without_new_constant_marking'
288
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:203:in `load_file'
289
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
290
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:202:in `load_file'
291
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:94:in `require_or_load'
292
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:60:in `depend_on'
293
+ ./cases/../../lib/../../activesupport/lib/active_support/dependencies.rb:442:in `require_dependency'
294
+ ./cases/../../lib/active_record/fixtures.rb:854:in `try_to_load_dependency'
295
+ ./cases/../../lib/active_record/fixtures.rb:869:in `require_fixture_classes'
296
+ ./cases/../../lib/active_record/fixtures.rb:866:in `each'
297
+ ./cases/../../lib/active_record/fixtures.rb:866:in `require_fixture_classes'
298
+ ./cases/../../lib/active_record/fixtures.rb:849:in `fixtures'
299
+ cases/named_scope_test.rb:9
300
+ Topic Load (0.001968) SELECT * FROM "topics" 
301
+ Topic Load (0.001587) SELECT * FROM "topics" 
302
+ Topic Load (0.001227) SELECT * FROM "topics" 
303
+ Topic Load (0.000737) SELECT * FROM "topics" WHERE (content LIKE '%Have%') 
304
+ Topic Load (0.000648) SELECT * FROM "topics" WHERE (content LIKE '%Have%') 
305
+ Topic Load (0.000668) SELECT * FROM "topics" WHERE (content LIKE '%Have%') 
306
+ Topic Load (0.001049) SELECT * FROM "topics" 
307
+ Topic Load (0.000886) SELECT * FROM "topics" 
308
+ Topic Load (0.000795) SELECT * FROM "topics" 
309
+ Topic Load (0.000600) SELECT * FROM "topics" LIMIT 1
310
+ Topic Load (0.000330) SELECT * FROM "topics" LIMIT 1
311
+ SQL (0.000160) SELECT count(*) AS count_all FROM "topics" 
312
+ SQL (0.000155) SELECT count(*) AS count_all FROM "topics" 
313
+ SQL (0.000175) SELECT avg("topics".replies_count) AS avg_replies_count FROM "topics" 
314
+ SQL (0.000345) SELECT avg("topics".replies_count) AS avg_replies_count FROM "topics" 
315
+ Topic Load (0.000858) SELECT * FROM "topics" 
316
+ Author Load (0.000273) SELECT * FROM "authors" WHERE ("authors"."id" = 1) 
317
+ Post Load (0.000498) SELECT * FROM "posts" WHERE (body LIKE '%a%') 
318
+ Post Load (0.000720) SELECT * FROM "posts" WHERE ("posts".author_id = 1) 
319
+ Post Load (0.000482) SELECT * FROM "posts" WHERE (body LIKE '%a%') 
320
+ Post Load (0.000482) SELECT * FROM "posts" WHERE (body LIKE '%a%') 
321
+ Post Load (0.000391) SELECT * FROM "posts" WHERE ("posts".author_id = 1) AND (body LIKE '%a%') 
322
+ Author Load (0.000245) SELECT * FROM "authors" WHERE ("authors"."id" = 1) 
323
+ Comment Load (0.000789) SELECT * FROM "comments" WHERE (comments.body LIKE '%e%') 
324
+ Post Load (0.000692) SELECT * FROM "posts" WHERE ("posts".author_id = 1) 
325
+ Comment Load (0.000767) SELECT * FROM "comments" WHERE (comments.body LIKE '%e%') 
326
+ Comment Load (0.000879) SELECT "comments".* FROM "comments" INNER JOIN posts ON comments.post_id = posts.id WHERE (("posts".author_id = 1)) 
327
+ Comment Load (0.000803) SELECT * FROM "comments" WHERE (comments.body LIKE '%e%') 
328
+ Comment Load (0.000822) SELECT "comments".* FROM "comments" INNER JOIN posts ON comments.post_id = posts.id WHERE (("posts".author_id = 1)) AND (comments.body LIKE '%e%') 
329
+ Topic Load (0.000823) SELECT * FROM "topics" 
330
+ Topic Load (0.000792) SELECT * FROM "topics" 
331
+ Topic Load (0.000794) SELECT * FROM "topics" 
332
+ Topic Load (0.000813) SELECT * FROM "topics" 
333
+ Topic Load (0.000769) SELECT * FROM "topics" 
334
+ Topic Load (0.000316) SELECT * FROM "topics" LIMIT 1
335
+ Topic Load (0.000777) SELECT * FROM "topics" 
336
+ Topic Load (0.000800) SELECT * FROM "topics" 
337
+ Topic Load (0.000795) SELECT * FROM "topics" 
338
+ Topic Load (0.000391) SELECT * FROM "topics" WHERE ("topics"."id" = 3) 
339
+ Topic Load (0.000499) SELECT * FROM "topics" WHERE (written_on < '2005-07-15 09:28:00') 
340
+ Topic Load (0.000320) SELECT * FROM "topics" WHERE ("topics"."id" = 2) 
341
+ Topic Load (0.000326) SELECT * FROM "topics" WHERE (written_on < '2004-07-15 09:28:00') 
342
+ Topic Load (0.000491) SELECT * FROM "topics" WHERE (written_on < '2005-07-15 09:28:00') 
343
+ Topic Load (0.000325) SELECT * FROM "topics" WHERE (written_on < '2004-07-15 09:28:00') 
344
+ Topic Load (0.000821) SELECT * FROM "topics" 
345
+ Topic Create (0.000383) INSERT INTO "topics" ("title", "author_name", "type", "approved", "bonus_time", "replies_count", "author_email_address", "written_on", "content", "last_read", "parent_id") VALUES(NULL, NULL, NULL, 't', NULL, 0, 'test@test.com', '2008-04-30 00:24:48', NULL, NULL, NULL)
346
+ Topic Load (0.000944) SELECT * FROM "topics" 
347
+ Topic Load (0.001618) SELECT * FROM "topics" WHERE ("topics"."approved" = 't') 
348
+ Topic Load (0.001445) SELECT * FROM "topics" WHERE ("topics"."approved" = 't') 
349
+ Topic Load (0.000720) SELECT * FROM "topics" WHERE (replies_count > 0) 
350
+ Topic Load (0.000707) SELECT * FROM "topics" WHERE (replies_count > 0) 
351
+ Topic Load (0.000494) SELECT * FROM "topics" WHERE ((replies_count > 0) AND ("topics"."approved" = 't')) 
352
+ Topic Load (0.000863) SELECT * FROM "topics" WHERE ("topics"."approved" = 't') 
353
+ Topic Load (0.000855) SELECT * FROM "topics" WHERE ("topics"."approved" = 't') 
354
+ Topic Load (0.000867) SELECT * FROM "topics" WHERE ("topics"."approved" = 't') 
355
+ SQL (0.000208) SELECT count(*) AS count_all FROM "topics" WHERE ("topics"."approved" = 't') 
356
+ SQL (0.000195) SELECT count(*) AS count_all FROM "topics" WHERE ("topics"."approved" = 't') 
357
+ Reply Load (0.000574) SELECT * FROM "topics" WHERE ( ("topics"."type" = 'Reply' OR "topics"."type" = 'SillyReply' ) ) 
358
+ Reply Load (0.000504) SELECT * FROM "topics" WHERE ( ("topics"."type" = 'Reply' OR "topics"."type" = 'SillyReply' ) )