activerecord 2.0.4 → 2.0.5

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.

data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ *2.0.5* (October 19th, 2008)
2
+
3
+ * Added SQL escaping for :limit and :offset in MySQL [Jonathan Wiess]
4
+
5
+
1
6
  *2.0.4* (2nd September 2008)
2
7
 
3
8
  * Migrations: create_table supports primary_key_prefix_type. #10314 [student, thechrisoshow]
data/Rakefile CHANGED
@@ -174,7 +174,7 @@ spec = Gem::Specification.new do |s|
174
174
  s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
175
175
  end
176
176
 
177
- s.add_dependency('activesupport', '= 2.0.4' + PKG_BUILD)
177
+ s.add_dependency('activesupport', '= 2.0.5' + PKG_BUILD)
178
178
 
179
179
  s.files.delete "test/fixtures/fixture_database.sqlite"
180
180
  s.files.delete "test/fixtures/fixture_database_2.sqlite"
@@ -106,11 +106,16 @@ module ActiveRecord
106
106
  # SELECT * FROM suppliers LIMIT 10 OFFSET 50
107
107
  def add_limit_offset!(sql, options)
108
108
  if limit = options[:limit]
109
- sql << " LIMIT #{limit}"
109
+ sql << " LIMIT #{sanitize_limit(limit)}"
110
110
  if offset = options[:offset]
111
- sql << " OFFSET #{offset}"
111
+ sql << " OFFSET #{offset.to_i}"
112
112
  end
113
113
  end
114
+ sql
115
+ end
116
+
117
+ def sanitize_limit(limit)
118
+ limit.to_s[/,/] ? limit.split(',').map{ |i| i.to_i }.join(',') : limit.to_i
114
119
  end
115
120
 
116
121
  # Appends a locking clause to an SQL statement.
@@ -318,10 +318,11 @@ module ActiveRecord
318
318
 
319
319
  def add_limit_offset!(sql, options) #:nodoc:
320
320
  if limit = options[:limit]
321
+ limit = sanitize_limit(limit)
321
322
  unless offset = options[:offset]
322
323
  sql << " LIMIT #{limit}"
323
324
  else
324
- sql << " LIMIT #{offset}, #{limit}"
325
+ sql << " LIMIT #{offset.to_i}, #{limit}"
325
326
  end
326
327
  end
327
328
  end
@@ -2,7 +2,7 @@ module ActiveRecord
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 2
4
4
  MINOR = 0
5
- TINY = 4
5
+ TINY = 5
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -103,4 +103,24 @@ class AdapterTest < Test::Unit::TestCase
103
103
  end
104
104
  end
105
105
 
106
+ def test_add_limit_offset_should_sanitize_sql_injection_for_limit_without_comas
107
+ sql_inject = "1 select * from schema"
108
+ assert_equal " LIMIT 1", @connection.add_limit_offset!("", :limit=>sql_inject)
109
+ if current_adapter?(:MysqlAdapter)
110
+ assert_equal " LIMIT 7, 1", @connection.add_limit_offset!("", :limit=>sql_inject, :offset=>7)
111
+ else
112
+ assert_equal " LIMIT 1 OFFSET 7", @connection.add_limit_offset!("", :limit=>sql_inject, :offset=>7)
113
+ end
114
+ end
115
+
116
+ def test_add_limit_offset_should_sanitize_sql_injection_for_limit_with_comas
117
+ sql_inject = "1, 7 procedure help()"
118
+ if current_adapter?(:MysqlAdapter)
119
+ assert_equal " LIMIT 1,7", @connection.add_limit_offset!("", :limit=>sql_inject)
120
+ assert_equal " LIMIT 7, 1", @connection.add_limit_offset!("", :limit=> '1 ; DROP TABLE USERS', :offset=>7)
121
+ else
122
+ assert_equal " LIMIT 1,7", @connection.add_limit_offset!("", :limit=>sql_inject)
123
+ assert_equal " LIMIT 1,7 OFFSET 7", @connection.add_limit_offset!("", :limit=>sql_inject, :offset=>7)
124
+ end
125
+ end
106
126
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -9,7 +9,7 @@ autorequire: active_record
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-03 00:00:00 +02:00
12
+ date: 2008-10-19 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 2.0.4
23
+ version: 2.0.5
24
24
  version:
25
25
  description: Implements the ActiveRecord pattern (Fowler, PoEAA) for ORM. It ties database tables and classes together for business objects, like Customer or Subscription, that can find, save, and destroy themselves without resorting to manual SQL.
26
26
  email: david@loudthinking.com
@@ -140,7 +140,6 @@ files:
140
140
  - test/copy_table_test_sqlite.rb
141
141
  - test/datatype_test_postgresql.rb
142
142
  - test/date_time_test.rb
143
- - test/debug.log
144
143
  - test/default_test_firebird.rb
145
144
  - test/defaults_test.rb
146
145
  - test/deprecated_finder_test.rb
@@ -237,8 +236,6 @@ files:
237
236
  - test/fixtures/entrant.rb
238
237
  - test/fixtures/entrants.yml
239
238
  - test/fixtures/example.log
240
- - test/fixtures/fixture_database.sqlite3
241
- - test/fixtures/fixture_database_2.sqlite3
242
239
  - test/fixtures/fk_test_has_fk.yml
243
240
  - test/fixtures/fk_test_has_pk.yml
244
241
  - test/fixtures/flowers.jpg
@@ -1,358 +0,0 @@
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' ) )