activerecord 2.1.0 → 2.1.1

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 (86) hide show
  1. data/CHANGELOG +34 -0
  2. data/README +0 -0
  3. data/Rakefile +6 -5
  4. data/lib/active_record.rb +8 -10
  5. data/lib/active_record/association_preload.rb +17 -12
  6. data/lib/active_record/associations.rb +45 -27
  7. data/lib/active_record/associations/association_collection.rb +8 -5
  8. data/lib/active_record/associations/association_proxy.rb +2 -6
  9. data/lib/active_record/associations/belongs_to_association.rb +0 -0
  10. data/lib/active_record/associations/belongs_to_polymorphic_association.rb +0 -0
  11. data/lib/active_record/associations/has_and_belongs_to_many_association.rb +2 -3
  12. data/lib/active_record/associations/has_many_association.rb +16 -4
  13. data/lib/active_record/associations/has_many_through_association.rb +1 -1
  14. data/lib/active_record/associations/has_one_association.rb +2 -2
  15. data/lib/active_record/associations/has_one_through_association.rb +4 -0
  16. data/lib/active_record/base.rb +33 -15
  17. data/lib/active_record/calculations.rb +20 -7
  18. data/lib/active_record/callbacks.rb +0 -0
  19. data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +9 -6
  20. data/lib/active_record/connection_adapters/abstract/schema_statements.rb +17 -10
  21. data/lib/active_record/connection_adapters/abstract_adapter.rb +0 -0
  22. data/lib/active_record/connection_adapters/mysql_adapter.rb +53 -24
  23. data/lib/active_record/connection_adapters/postgresql_adapter.rb +66 -20
  24. data/lib/active_record/connection_adapters/sqlite_adapter.rb +12 -0
  25. data/lib/active_record/dirty.rb +10 -3
  26. data/lib/active_record/fixtures.rb +0 -0
  27. data/lib/active_record/locking/optimistic.rb +1 -0
  28. data/lib/active_record/migration.rb +35 -8
  29. data/lib/active_record/named_scope.rb +6 -1
  30. data/lib/active_record/observer.rb +7 -5
  31. data/lib/active_record/test_case.rb +13 -2
  32. data/lib/active_record/validations.rb +19 -9
  33. data/lib/active_record/version.rb +1 -1
  34. data/test/cases/active_schema_test_postgresql.rb +2 -2
  35. data/test/cases/adapter_test.rb +1 -1
  36. data/test/cases/associations/belongs_to_associations_test.rb +19 -0
  37. data/test/cases/associations/cascaded_eager_loading_test.rb +13 -1
  38. data/test/cases/associations/eager_load_includes_full_sti_class_test.rb +36 -0
  39. data/test/cases/associations/eager_test.rb +25 -1
  40. data/test/cases/associations/has_and_belongs_to_many_associations_test.rb +27 -5
  41. data/test/cases/associations/has_many_associations_test.rb +106 -4
  42. data/test/cases/associations/has_many_through_associations_test.rb +10 -0
  43. data/test/cases/associations/has_one_associations_test.rb +22 -0
  44. data/test/cases/associations/has_one_through_associations_test.rb +44 -5
  45. data/test/cases/associations/join_model_test.rb +7 -0
  46. data/test/cases/associations_test.rb +2 -2
  47. data/test/cases/attribute_methods_test.rb +10 -10
  48. data/test/cases/base_test.rb +39 -16
  49. data/test/cases/calculations_test.rb +53 -1
  50. data/test/cases/column_definition_test.rb +36 -0
  51. data/test/cases/database_statements_test.rb +12 -0
  52. data/test/cases/defaults_test.rb +1 -1
  53. data/test/cases/deprecated_finder_test.rb +0 -0
  54. data/test/cases/dirty_test.rb +94 -0
  55. data/test/cases/finder_test.rb +7 -0
  56. data/test/cases/fixtures_test.rb +0 -0
  57. data/test/cases/helper.rb +5 -5
  58. data/test/cases/inheritance_test.rb +9 -2
  59. data/test/cases/lifecycle_test.rb +54 -1
  60. data/test/cases/locking_test.rb +20 -0
  61. data/test/cases/method_scoping_test.rb +11 -1
  62. data/test/cases/migration_test.rb +147 -22
  63. data/test/cases/multiple_db_test.rb +1 -1
  64. data/test/cases/named_scope_test.rb +50 -1
  65. data/test/cases/query_cache_test.rb +4 -3
  66. data/test/cases/readonly_test.rb +0 -0
  67. data/test/cases/reflection_test.rb +3 -3
  68. data/test/cases/schema_dumper_test.rb +46 -0
  69. data/test/cases/unconnected_test.rb +0 -0
  70. data/test/cases/validations_test.rb +30 -5
  71. data/test/debug.log +358 -0
  72. data/test/fixtures/fixture_database.sqlite3 +0 -0
  73. data/test/fixtures/fixture_database_2.sqlite3 +0 -0
  74. data/test/models/author.rb +4 -0
  75. data/test/models/category.rb +1 -0
  76. data/test/models/company.rb +10 -1
  77. data/test/models/developer.rb +4 -1
  78. data/test/models/person.rb +1 -1
  79. data/test/models/post.rb +6 -1
  80. data/test/models/project.rb +1 -1
  81. data/test/models/reply.rb +0 -0
  82. data/test/models/topic.rb +1 -0
  83. data/test/schema/mysql_specific_schema.rb +2 -2
  84. data/test/schema/schema.rb +8 -0
  85. metadata +11 -5
  86. data/lib/active_record/vendor/db2.rb +0 -362
@@ -51,7 +51,7 @@ class MultipleDbTest < ActiveRecord::TestCase
51
51
  def test_course_connection_should_survive_dependency_reload
52
52
  assert Course.connection
53
53
 
54
- Dependencies.clear
54
+ ActiveSupport::Dependencies.clear
55
55
  Object.send(:remove_const, :Course)
56
56
  require_dependency 'models/course'
57
57
 
@@ -4,9 +4,10 @@ require 'models/topic'
4
4
  require 'models/comment'
5
5
  require 'models/reply'
6
6
  require 'models/author'
7
+ require 'models/developer'
7
8
 
8
9
  class NamedScopeTest < ActiveRecord::TestCase
9
- fixtures :posts, :authors, :topics, :comments
10
+ fixtures :posts, :authors, :topics, :comments, :author_addresses
10
11
 
11
12
  def test_implements_enumerable
12
13
  assert !Topic.find(:all).empty?
@@ -45,6 +46,17 @@ class NamedScopeTest < ActiveRecord::TestCase
45
46
  assert_equal Topic.average(:replies_count), Topic.base.average(:replies_count)
46
47
  end
47
48
 
49
+ def test_scope_should_respond_to_own_methods_and_methods_of_the_proxy
50
+ assert Topic.approved.respond_to?(:proxy_found)
51
+ assert Topic.approved.respond_to?(:count)
52
+ assert Topic.approved.respond_to?(:length)
53
+ end
54
+
55
+ def test_respond_to_respects_include_private_parameter
56
+ assert !Topic.approved.respond_to?(:load_found)
57
+ assert Topic.approved.respond_to?(:load_found, true)
58
+ end
59
+
48
60
  def test_subclasses_inherit_scopes
49
61
  assert Topic.scopes.include?(:base)
50
62
 
@@ -59,6 +71,12 @@ class NamedScopeTest < ActiveRecord::TestCase
59
71
  assert_equal Topic.count(:conditions => {:approved => true}), Topic.approved.count
60
72
  end
61
73
 
74
+ def test_scopes_with_string_name_can_be_composed
75
+ # NOTE that scopes defined with a string as a name worked on their own
76
+ # but when called on another scope the other scope was completely replaced
77
+ assert_equal Topic.replied.approved, Topic.replied.approved_as_string
78
+ end
79
+
62
80
  def test_scopes_are_composable
63
81
  assert_equal (approved = Topic.find(:all, :conditions => {:approved => true})), Topic.approved
64
82
  assert_equal (replied = Topic.find(:all, :conditions => 'replies_count > 0')), Topic.replied
@@ -77,6 +95,25 @@ class NamedScopeTest < ActiveRecord::TestCase
77
95
  assert_equal topics_written_before_the_second, Topic.written_before(topics(:second).written_on)
78
96
  end
79
97
 
98
+ def test_scopes_with_joins
99
+ address = author_addresses(:david_address)
100
+ posts_with_authors_at_address = Post.find(
101
+ :all, :joins => 'JOIN authors ON authors.id = posts.author_id',
102
+ :conditions => [ 'authors.author_address_id = ?', address.id ]
103
+ )
104
+ assert_equal posts_with_authors_at_address, Post.with_authors_at_address(address)
105
+ end
106
+
107
+ def test_scopes_with_joins_respects_custom_select
108
+ address = author_addresses(:david_address)
109
+ posts_with_authors_at_address_titles = Post.find(:all,
110
+ :select => 'title',
111
+ :joins => 'JOIN authors ON authors.id = posts.author_id',
112
+ :conditions => [ 'authors.author_address_id = ?', address.id ]
113
+ )
114
+ assert_equal posts_with_authors_at_address_titles, Post.with_authors_at_address(address).find(:all, :select => 'title')
115
+ end
116
+
80
117
  def test_extensions
81
118
  assert_equal 1, Topic.anonymous_extension.one
82
119
  assert_equal 2, Topic.named_extension.two
@@ -154,4 +191,16 @@ class NamedScopeTest < ActiveRecord::TestCase
154
191
  topics.empty? # use loaded (no query)
155
192
  end
156
193
  end
194
+
195
+ def test_find_all_should_behave_like_select
196
+ assert_equal Topic.base.select(&:approved), Topic.base.find_all(&:approved)
197
+ end
198
+
199
+ def test_rand_should_select_a_random_object_from_proxy
200
+ assert Topic.approved.rand.is_a?(Topic)
201
+ end
202
+
203
+ def test_should_use_where_in_query_for_named_scope
204
+ assert_equal Developer.find_all_by_name('Jamis'), Developer.find_all_by_id(Developer.jamises)
205
+ end
157
206
  end
@@ -58,7 +58,7 @@ end
58
58
  uses_mocha 'QueryCacheExpiryTest' do
59
59
 
60
60
  class QueryCacheExpiryTest < ActiveRecord::TestCase
61
- fixtures :tasks
61
+ fixtures :tasks, :posts, :categories, :categories_posts
62
62
 
63
63
  def test_find
64
64
  Task.connection.expects(:clear_query_cache).times(1)
@@ -116,8 +116,9 @@ class QueryCacheExpiryTest < ActiveRecord::TestCase
116
116
  def test_cache_is_expired_by_habtm_delete
117
117
  ActiveRecord::Base.connection.expects(:clear_query_cache).times(2)
118
118
  ActiveRecord::Base.cache do
119
- c = Category.find(:first)
120
- p = Post.find(:first)
119
+ c = Category.find(1)
120
+ p = Post.find(1)
121
+ assert p.categories.any?
121
122
  p.categories.delete_all
122
123
  end
123
124
  end
File without changes
@@ -160,9 +160,9 @@ class ReflectionTest < ActiveRecord::TestCase
160
160
 
161
161
  def test_reflection_of_all_associations
162
162
  # FIXME these assertions bust a lot
163
- assert_equal 20, Firm.reflect_on_all_associations.size
164
- assert_equal 16, Firm.reflect_on_all_associations(:has_many).size
165
- assert_equal 4, Firm.reflect_on_all_associations(:has_one).size
163
+ assert_equal 22, Firm.reflect_on_all_associations.size
164
+ assert_equal 17, Firm.reflect_on_all_associations(:has_many).size
165
+ assert_equal 5, Firm.reflect_on_all_associations(:has_one).size
166
166
  assert_equal 0, Firm.reflect_on_all_associations(:belongs_to).size
167
167
  end
168
168
 
@@ -72,6 +72,52 @@ class SchemaDumperTest < ActiveRecord::TestCase
72
72
  assert_match %r{:null => false}, output
73
73
  end
74
74
 
75
+ def test_schema_dump_includes_limit_constraint_for_integer_columns
76
+ stream = StringIO.new
77
+
78
+ ActiveRecord::SchemaDumper.ignore_tables = [/^(?!integer_limits)/]
79
+ ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, stream)
80
+ output = stream.string
81
+
82
+ if current_adapter?(:PostgreSQLAdapter)
83
+ assert_match %r{c_int_1.*:limit => 2}, output
84
+ assert_match %r{c_int_2.*:limit => 2}, output
85
+
86
+ # int 3 is 4 bytes in postgresql
87
+ assert_match %r{c_int_3.*}, output
88
+ assert_no_match %r{c_int_3.*:limit}, output
89
+
90
+ assert_match %r{c_int_4.*}, output
91
+ assert_no_match %r{c_int_4.*:limit}, output
92
+ elsif current_adapter?(:MysqlAdapter)
93
+ assert_match %r{c_int_1.*:limit => 1}, output
94
+ assert_match %r{c_int_2.*:limit => 2}, output
95
+ assert_match %r{c_int_3.*:limit => 3}, output
96
+
97
+ assert_match %r{c_int_4.*}, output
98
+ assert_no_match %r{c_int_4.*:limit}, output
99
+ elsif current_adapter?(:SQLiteAdapter)
100
+ assert_match %r{c_int_1.*:limit => 1}, output
101
+ assert_match %r{c_int_2.*:limit => 2}, output
102
+ assert_match %r{c_int_3.*:limit => 3}, output
103
+ assert_match %r{c_int_4.*:limit => 4}, output
104
+ end
105
+ assert_match %r{c_int_without_limit.*}, output
106
+ assert_no_match %r{c_int_without_limit.*:limit}, output
107
+
108
+ if current_adapter?(:SQLiteAdapter)
109
+ assert_match %r{c_int_5.*:limit => 5}, output
110
+ assert_match %r{c_int_6.*:limit => 6}, output
111
+ assert_match %r{c_int_7.*:limit => 7}, output
112
+ assert_match %r{c_int_8.*:limit => 8}, output
113
+ else
114
+ assert_match %r{c_int_5.*:limit => 8}, output
115
+ assert_match %r{c_int_6.*:limit => 8}, output
116
+ assert_match %r{c_int_7.*:limit => 8}, output
117
+ assert_match %r{c_int_8.*:limit => 8}, output
118
+ end
119
+ end
120
+
75
121
  def test_schema_dump_with_string_ignored_table
76
122
  stream = StringIO.new
77
123
 
File without changes
@@ -451,6 +451,18 @@ class ValidationsTest < ActiveRecord::TestCase
451
451
  t2.title = nil
452
452
  assert t2.valid?, "should validate with nil"
453
453
  assert t2.save, "should save with nil"
454
+
455
+ with_kcode('UTF8') do
456
+ t_utf8 = Topic.new("title" => "Я тоже уникальный!")
457
+ assert t_utf8.save, "Should save t_utf8 as unique"
458
+
459
+ # If database hasn't UTF-8 character set, this test fails
460
+ if Topic.find(t_utf8, :select => 'LOWER(title) AS title').title == "я тоже уникальный!"
461
+ t2_utf8 = Topic.new("title" => "я тоже УНИКАЛЬНЫЙ!")
462
+ assert !t2_utf8.valid?, "Shouldn't be valid"
463
+ assert !t2_utf8.save, "Shouldn't save t2_utf8 as unique"
464
+ end
465
+ end
454
466
  end
455
467
 
456
468
  def test_validate_case_sensitive_uniqueness
@@ -1059,6 +1071,18 @@ class ValidationsTest < ActiveRecord::TestCase
1059
1071
  end
1060
1072
  end
1061
1073
 
1074
+ def test_validates_length_of_with_block
1075
+ Topic.validates_length_of :content, :minimum => 5, :too_short=>"Your essay must be at least %d words.",
1076
+ :tokenizer => lambda {|str| str.scan(/\w+/) }
1077
+ t = Topic.create!(:content => "this content should be long enough")
1078
+ assert t.valid?
1079
+
1080
+ t.content = "not long enough"
1081
+ assert !t.valid?
1082
+ assert t.errors.on(:content)
1083
+ assert_equal "Your essay must be at least 5 words.", t.errors[:content]
1084
+ end
1085
+
1062
1086
  def test_validates_size_of_association_utf8
1063
1087
  with_kcode('UTF8') do
1064
1088
  assert_nothing_raised { Topic.validates_size_of :replies, :minimum => 1 }
@@ -1379,6 +1403,7 @@ class ValidatesNumericalityTest < ActiveRecord::TestCase
1379
1403
  INTEGERS = [0, 10, -10] + INTEGER_STRINGS
1380
1404
  BIGDECIMAL = BIGDECIMAL_STRINGS.collect! { |bd| BigDecimal.new(bd) }
1381
1405
  JUNK = ["not a number", "42 not a number", "0xdeadbeef", "00-1", "--3", "+-3", "+3-1", "-+019.0", "12.12.13.12", "123\nnot a number"]
1406
+ INFINITY = [1.0/0.0]
1382
1407
 
1383
1408
  def setup
1384
1409
  Topic.instance_variable_set("@validate_callbacks", ActiveSupport::Callbacks::CallbackChain.new)
@@ -1390,27 +1415,27 @@ class ValidatesNumericalityTest < ActiveRecord::TestCase
1390
1415
  Topic.validates_numericality_of :approved
1391
1416
 
1392
1417
  invalid!(NIL + BLANK + JUNK)
1393
- valid!(FLOATS + INTEGERS + BIGDECIMAL)
1418
+ valid!(FLOATS + INTEGERS + BIGDECIMAL + INFINITY)
1394
1419
  end
1395
1420
 
1396
1421
  def test_validates_numericality_of_with_nil_allowed
1397
1422
  Topic.validates_numericality_of :approved, :allow_nil => true
1398
1423
 
1399
1424
  invalid!(BLANK + JUNK)
1400
- valid!(NIL + FLOATS + INTEGERS + BIGDECIMAL)
1425
+ valid!(NIL + FLOATS + INTEGERS + BIGDECIMAL + INFINITY)
1401
1426
  end
1402
1427
 
1403
1428
  def test_validates_numericality_of_with_integer_only
1404
1429
  Topic.validates_numericality_of :approved, :only_integer => true
1405
1430
 
1406
- invalid!(NIL + BLANK + JUNK + FLOATS + BIGDECIMAL)
1431
+ invalid!(NIL + BLANK + JUNK + FLOATS + BIGDECIMAL + INFINITY)
1407
1432
  valid!(INTEGERS)
1408
1433
  end
1409
1434
 
1410
1435
  def test_validates_numericality_of_with_integer_only_and_nil_allowed
1411
1436
  Topic.validates_numericality_of :approved, :only_integer => true, :allow_nil => true
1412
1437
 
1413
- invalid!(BLANK + JUNK + FLOATS + BIGDECIMAL)
1438
+ invalid!(BLANK + JUNK + FLOATS + BIGDECIMAL + INFINITY)
1414
1439
  valid!(NIL + INTEGERS)
1415
1440
  end
1416
1441
 
@@ -1431,7 +1456,7 @@ class ValidatesNumericalityTest < ActiveRecord::TestCase
1431
1456
  def test_validates_numericality_with_equal_to
1432
1457
  Topic.validates_numericality_of :approved, :equal_to => 10
1433
1458
 
1434
- invalid!([-10, 11], 'must be equal to 10')
1459
+ invalid!([-10, 11] + INFINITY, 'must be equal to 10')
1435
1460
  valid!([10])
1436
1461
  end
1437
1462
 
@@ -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' ) )