joinfix 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/rails/log/test.log CHANGED
@@ -1,4 +1,11 @@
1
- # Logfile created on Sat May 12 23:25:48 Mountain Daylight Time 2007 by logger.rb/1.5.2.7
1
+ # Logfile created on Fri May 11 18:06:54 Mountain Daylight Time 2007 by logger.rb/1.5.2.7
2
+ SQL (0.015000) SET SQL_AUTO_IS_NULL=0
3
+ SQL (0.000000) BEGIN
4
+ SQL (0.000000) ROLLBACK
5
+ SQL (0.000000) BEGIN
6
+ SQL (0.000000) ROLLBACK
7
+ SQL (0.000000) BEGIN
8
+ SQL (0.000000) ROLLBACK
2
9
  SQL (0.000000) SET SQL_AUTO_IS_NULL=0
3
10
  SQL (0.000000) BEGIN
4
11
  SQL (0.000000) ROLLBACK
@@ -6,7 +13,7 @@
6
13
  SQL (0.000000) ROLLBACK
7
14
  SQL (0.000000) BEGIN
8
15
  NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 1) 
9
- NestedChild Load (0.010000) SELECT * FROM nested_children WHERE (nested_children.`field` = 3) LIMIT 1
16
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`field` = 3) LIMIT 1
10
17
  SQL (0.000000) ROLLBACK
11
18
  SQL (0.000000) BEGIN
12
19
  NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 4) 
@@ -21,22 +28,22 @@
21
28
  NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 2) 
22
29
  NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`field` = 1) LIMIT 1
23
30
  InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`id` = 3) 
24
- NestedChild Load (0.010000) SELECT * FROM nested_children WHERE (nested_children.`id` = 3) 
31
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 3) 
25
32
  NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 1) 
26
33
  InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`field` = 3) LIMIT 1
27
34
  NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 1) 
28
35
  SQL (0.000000) ROLLBACK
29
36
  SQL (0.000000) BEGIN
30
- SQL (0.010000) ROLLBACK
37
+ SQL (0.000000) ROLLBACK
31
38
  SQL (0.000000) BEGIN
32
39
  User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 2) 
33
- Group Load (0.020000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 2)) 
40
+ Group Load (0.000000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 2)) 
34
41
  User Load (0.000000) SELECT * FROM users WHERE (users.`login` = 'jane') LIMIT 1
35
42
  SQL (0.000000) SELECT count(*) AS count_all FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 3)) 
36
43
  UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 2) 
37
44
  UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 2) 
38
45
  User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 3) 
39
- User Load (0.010000) SELECT * FROM users WHERE (users.`id` = 1) 
46
+ User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 1) 
40
47
  User Load (0.000000) SELECT * FROM users WHERE (users.`login` = 'sam') LIMIT 1
41
48
  Group Load (0.000000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 1)) AND (groups.`name` = 'movers') LIMIT 1
42
49
  User Load (0.000000) SELECT users.* FROM users INNER JOIN user_groups ON users.id = user_groups.user_id WHERE ((user_groups.group_id = 3)) 
@@ -47,10 +54,44 @@
47
54
  SQL (0.000000) BEGIN
48
55
  SQL (0.000000) ROLLBACK
49
56
  SQL (0.000000) BEGIN
50
- NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 1) 
51
- NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`field` = 3) LIMIT 1
57
+ NestedChild Columns (0.047000) SHOW FIELDS FROM nested_children
58
+ NestedChild Load (0.031000) SELECT * FROM nested_children WHERE (nested_children.`id` = 1) 
59
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`field` = 3) LIMIT 1
60
+ SQL (0.000000) ROLLBACK
61
+ SQL (0.000000) BEGIN
62
+ NestedParent Columns (0.016000) SHOW FIELDS FROM nested_parents
63
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 4) 
64
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 1) 
65
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 3) 
66
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 2) 
67
+ NestedChild Load (0.015000) SELECT * FROM nested_children WHERE (nested_children.`field` = 1) LIMIT 1
68
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 4) 
69
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`field` = 1) LIMIT 1
70
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.nested_parent_id = 4) 
71
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.nested_child_id = 2) 
72
+ InnerChild Columns (0.000000) SHOW FIELDS FROM inner_children
73
+ NestedParent Load (0.016000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 2) 
74
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`field` = 1) LIMIT 1
75
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`id` = 3) 
76
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 3) 
77
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 1) 
78
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`field` = 3) LIMIT 1
79
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 1) 
80
+ SQL (0.000000) ROLLBACK
81
+ SQL (0.000000) BEGIN
82
+ SQL (0.000000) ROLLBACK
83
+ SQL (0.000000) SET SQL_AUTO_IS_NULL=0
84
+ SQL (0.000000) BEGIN
85
+ SQL (0.000000) ROLLBACK
86
+ SQL (0.000000) BEGIN
52
87
  SQL (0.000000) ROLLBACK
53
88
  SQL (0.000000) BEGIN
89
+ NestedChild Columns (0.016000) SHOW FIELDS FROM nested_children
90
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 1) 
91
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`field` = 3) LIMIT 1
92
+ SQL (0.000000) ROLLBACK
93
+ SQL (0.000000) BEGIN
94
+ NestedParent Columns (0.000000) SHOW FIELDS FROM nested_parents
54
95
  NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 4) 
55
96
  NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 1) 
56
97
  NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 3) 
@@ -59,27 +100,313 @@
59
100
  NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 4) 
60
101
  NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`field` = 1) LIMIT 1
61
102
  NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.nested_parent_id = 4) 
62
- InnerChild Load (0.060000) SELECT * FROM inner_children WHERE (inner_children.nested_child_id = 2) 
63
- NestedParent Load (0.030000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 2) 
103
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.nested_child_id = 2) 
104
+ InnerChild Columns (0.000000) SHOW FIELDS FROM inner_children
105
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 2) 
106
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`field` = 1) LIMIT 1
107
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`id` = 3) 
108
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 3) 
109
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 1) 
110
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`field` = 3) LIMIT 1
111
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 1) 
112
+ SQL (0.000000) ROLLBACK
113
+ SQL (0.000000) BEGIN
114
+ SQL (0.000000) ROLLBACK
115
+ SQL (0.000000) BEGIN
116
+ SQL (0.015000) ROLLBACK
117
+ SQL (0.000000) BEGIN
118
+ User Columns (0.000000) SHOW FIELDS FROM users
119
+ User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 1) 
120
+ Group Load (0.000000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 1)) 
121
+ Group Columns (0.016000) SHOW FIELDS FROM groups
122
+ User Load (0.000000) SELECT * FROM users WHERE (users.`full_name` = 'Jane Doe') LIMIT 1
123
+ SQL (0.000000) SELECT count(*) AS count_all FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 3)) 
124
+ UserGroup Columns (0.015000) SHOW FIELDS FROM user_groups
125
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 3) 
126
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 3) 
127
+ Group Load (0.000000) SELECT * FROM groups WHERE (groups.`id` = 2) 
128
+ SQL (0.000000) ROLLBACK
129
+ SQL (0.000000) BEGIN
130
+ User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 2) 
131
+ Group Load (0.000000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 2)) 
132
+ User Load (0.000000) SELECT * FROM users WHERE (users.`full_name` = 'Jane Doe Nested') LIMIT 1
133
+ SQL (0.000000) SELECT count(*) AS count_all FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 30)) 
134
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 4) 
135
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 4) 
136
+ User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 30) 
137
+ SQL (0.000000) ROLLBACK
138
+ SQL (0.000000) SET SQL_AUTO_IS_NULL=0
139
+ SQL (0.000000) BEGIN
140
+ SQL (0.000000) ROLLBACK
141
+ SQL (0.000000) BEGIN
142
+ SQL (0.000000) ROLLBACK
143
+ SQL (0.000000) BEGIN
144
+ NestedChild Columns (0.015000) SHOW FIELDS FROM nested_children
145
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 1) 
146
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`field` = 3) LIMIT 1
147
+ SQL (0.000000) ROLLBACK
148
+ SQL (0.000000) BEGIN
149
+ NestedParent Columns (0.000000) SHOW FIELDS FROM nested_parents
150
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 4) 
151
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 1) 
152
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 3) 
153
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 2) 
154
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`field` = 1) LIMIT 1
155
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 4) 
64
156
  NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`field` = 1) LIMIT 1
65
- InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`id` = 3) 
66
- NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 3) 
157
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.nested_parent_id = 4) 
158
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.nested_child_id = 2) 
159
+ InnerChild Columns (0.000000) SHOW FIELDS FROM inner_children
160
+ NestedParent Load (0.016000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 2) 
161
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`field` = 1) LIMIT 1
162
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`id` = 3) 
163
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 3) 
164
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 1) 
165
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`field` = 3) LIMIT 1
166
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 1) 
167
+ SQL (0.000000) ROLLBACK
168
+ SQL (0.000000) BEGIN
169
+ SQL (0.000000) ROLLBACK
170
+ SQL (0.000000) BEGIN
171
+ SQL (0.000000) ROLLBACK
172
+ SQL (0.000000) BEGIN
173
+ User Columns (0.000000) SHOW FIELDS FROM users
174
+ User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 1) 
175
+ Group Load (0.000000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 1)) 
176
+ Group Columns (0.015000) SHOW FIELDS FROM groups
177
+ User Load (0.000000) SELECT * FROM users WHERE (users.`full_name` = 'Jane Doe') LIMIT 1
178
+ SQL (0.000000) SELECT count(*) AS count_all FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 2)) 
179
+ UserGroup Columns (0.016000) SHOW FIELDS FROM user_groups
180
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 3) 
181
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 3) 
182
+ Group Load (0.000000) SELECT * FROM groups WHERE (groups.`id` = 1) 
183
+ SQL (0.000000) ROLLBACK
184
+ SQL (0.000000) BEGIN
185
+ User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 4) 
186
+ Group Load (0.000000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 4)) 
187
+ User Load (0.000000) SELECT * FROM users WHERE (users.`full_name` = 'Jane Doe Nested') LIMIT 1
188
+ SQL (0.000000) SELECT count(*) AS count_all FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 3)) 
189
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 4) 
190
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 4) 
191
+ Group Load (0.000000) SELECT * FROM groups WHERE (groups.`id` = 2) 
192
+ SQL (0.000000) ROLLBACK
193
+ SQL (0.000000) SET SQL_AUTO_IS_NULL=0
194
+ SQL (0.000000) BEGIN
195
+ SQL (0.000000) ROLLBACK
196
+ SQL (0.000000) BEGIN
197
+ SQL (0.000000) ROLLBACK
198
+ SQL (0.000000) BEGIN
199
+ NestedChild Columns (0.016000) SHOW FIELDS FROM nested_children
200
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 1) 
201
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`field` = 3) LIMIT 1
202
+ SQL (0.000000) ROLLBACK
203
+ SQL (0.000000) BEGIN
204
+ NestedParent Columns (0.000000) SHOW FIELDS FROM nested_parents
205
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 4) 
67
206
  NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 1) 
68
- InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`field` = 3) LIMIT 1
69
- NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 1) 
207
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 3) 
208
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 2) 
209
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`field` = 1) LIMIT 1
210
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 4) 
211
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`field` = 1) LIMIT 1
212
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.nested_parent_id = 4) 
213
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.nested_child_id = 2) 
214
+ InnerChild Columns (0.000000) SHOW FIELDS FROM inner_children
215
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 2) 
216
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`field` = 1) LIMIT 1
217
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`id` = 3) 
218
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 3) 
219
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 1) 
220
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`field` = 3) LIMIT 1
221
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 1) 
222
+ SQL (0.000000) ROLLBACK
223
+ SQL (0.000000) BEGIN
224
+ SQL (0.000000) ROLLBACK
225
+ SQL (0.000000) BEGIN
226
+ SQL (0.000000) ROLLBACK
227
+ SQL (0.000000) BEGIN
228
+ User Columns (0.000000) SHOW FIELDS FROM users
229
+ User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 1) 
230
+ Group Load (0.000000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 1)) 
231
+ Group Columns (0.000000) SHOW FIELDS FROM groups
232
+ User Load (0.000000) SELECT * FROM users WHERE (users.`full_name` = 'Jane Doe') LIMIT 1
233
+ SQL (0.000000) SELECT count(*) AS count_all FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 2)) 
234
+ UserGroup Columns (0.015000) SHOW FIELDS FROM user_groups
235
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 2) 
236
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 2) 
237
+ Group Load (0.000000) SELECT * FROM groups WHERE (groups.`id` = 3) 
238
+ SQL (0.000000) ROLLBACK
239
+ SQL (0.000000) BEGIN
240
+ User Load (0.016000) SELECT * FROM users WHERE (users.`id` = 4) 
241
+ Group Load (0.000000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 4)) 
242
+ User Load (0.000000) SELECT * FROM users WHERE (users.`full_name` = 'Jane Doe Nested') LIMIT 1
243
+ SQL (0.000000) SELECT count(*) AS count_all FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 3)) 
244
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 5) 
245
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 5) 
246
+ Group Load (0.000000) SELECT * FROM groups WHERE (groups.`id` = 30) 
70
247
  SQL (0.000000) ROLLBACK
248
+ SQL (0.000000) SET SQL_AUTO_IS_NULL=0
71
249
  SQL (0.000000) BEGIN
72
250
  SQL (0.000000) ROLLBACK
73
251
  SQL (0.000000) BEGIN
74
- User Load (0.010000) SELECT * FROM users WHERE (users.`id` = 2) 
75
- Group Load (0.060000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 2)) 
76
- User Load (0.000000) SELECT * FROM users WHERE (users.`login` = 'jane') LIMIT 1
77
- SQL (0.010000) SELECT count(*) AS count_all FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 3)) 
252
+ SQL (0.000000) ROLLBACK
253
+ SQL (0.000000) BEGIN
254
+ NestedChild Columns (0.015000) SHOW FIELDS FROM nested_children
255
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 1) 
256
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`field` = 3) LIMIT 1
257
+ SQL (0.000000) ROLLBACK
258
+ SQL (0.000000) BEGIN
259
+ NestedParent Columns (0.000000) SHOW FIELDS FROM nested_parents
260
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 4) 
261
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 1) 
262
+ NestedParent Load (0.015000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 3) 
263
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 2) 
264
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`field` = 1) LIMIT 1
265
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 4) 
266
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`field` = 1) LIMIT 1
267
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.nested_parent_id = 4) 
268
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.nested_child_id = 2) 
269
+ InnerChild Columns (0.000000) SHOW FIELDS FROM inner_children
270
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 2) 
271
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`field` = 1) LIMIT 1
272
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`id` = 3) 
273
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 3) 
274
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 1) 
275
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`field` = 3) LIMIT 1
276
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 1) 
277
+ SQL (0.000000) ROLLBACK
278
+ SQL (0.000000) BEGIN
279
+ SQL (0.000000) ROLLBACK
280
+ SQL (0.000000) BEGIN
281
+ SQL (0.000000) ROLLBACK
282
+ SQL (0.000000) BEGIN
283
+ User Columns (0.000000) SHOW FIELDS FROM users
284
+ User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 1) 
285
+ Group Load (0.000000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 1)) 
286
+ Group Columns (0.000000) SHOW FIELDS FROM groups
287
+ User Load (0.000000) SELECT * FROM users WHERE (users.`full_name` = 'Jane Doe') LIMIT 1
288
+ SQL (0.000000) SELECT count(*) AS count_all FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 2)) 
289
+ UserGroup Columns (0.000000) SHOW FIELDS FROM user_groups
78
290
  UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 2) 
79
291
  UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 2) 
80
- User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 3) 
81
- User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 1) 
82
- User Load (0.000000) SELECT * FROM users WHERE (users.`login` = 'sam') LIMIT 1
83
- Group Load (0.000000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 1)) AND (groups.`name` = 'movers') LIMIT 1
84
- User Load (0.000000) SELECT users.* FROM users INNER JOIN user_groups ON users.id = user_groups.user_id WHERE ((user_groups.group_id = 4)) 
292
+ Group Load (0.000000) SELECT * FROM groups WHERE (groups.`id` = 3) 
293
+ SQL (0.000000) ROLLBACK
294
+ SQL (0.000000) BEGIN
295
+ User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 4) 
296
+ Group Load (0.000000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 4)) 
297
+ User Load (0.000000) SELECT * FROM users WHERE (users.`full_name` = 'Jane Doe Nested') LIMIT 1
298
+ SQL (0.000000) SELECT count(*) AS count_all FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 3)) 
299
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 5) 
300
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 5) 
301
+ Group Load (0.000000) SELECT * FROM groups WHERE (groups.`id` = 30) 
302
+ SQL (0.000000) ROLLBACK
303
+ SQL (0.000000) SET SQL_AUTO_IS_NULL=0
304
+ SQL (0.000000) BEGIN
305
+ SQL (0.000000) ROLLBACK
306
+ SQL (0.000000) BEGIN
307
+ SQL (0.000000) ROLLBACK
308
+ SQL (0.000000) BEGIN
309
+ NestedChild Columns (0.016000) SHOW FIELDS FROM nested_children
310
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 1) 
311
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`field` = 3) LIMIT 1
312
+ SQL (0.000000) ROLLBACK
313
+ SQL (0.000000) BEGIN
314
+ NestedParent Columns (0.016000) SHOW FIELDS FROM nested_parents
315
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 4) 
316
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 1) 
317
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 3) 
318
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 2) 
319
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`field` = 1) LIMIT 1
320
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 4) 
321
+ NestedParent Load (0.016000) SELECT * FROM nested_parents WHERE (nested_parents.`field` = 1) LIMIT 1
322
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.nested_parent_id = 4) 
323
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.nested_child_id = 2) 
324
+ InnerChild Columns (0.000000) SHOW FIELDS FROM inner_children
325
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 2) 
326
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`field` = 1) LIMIT 1
327
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`id` = 3) 
328
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 3) 
329
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 1) 
330
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`field` = 3) LIMIT 1
331
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 1) 
332
+ SQL (0.000000) ROLLBACK
333
+ SQL (0.000000) BEGIN
334
+ SQL (0.000000) ROLLBACK
335
+ SQL (0.000000) BEGIN
336
+ SQL (0.000000) ROLLBACK
337
+ SQL (0.000000) BEGIN
338
+ User Columns (0.000000) SHOW FIELDS FROM users
339
+ User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 1) 
340
+ Group Load (0.000000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 1)) 
341
+ Group Columns (0.000000) SHOW FIELDS FROM groups
342
+ User Load (0.000000) SELECT * FROM users WHERE (users.`full_name` = 'Jane Doe') LIMIT 1
343
+ SQL (0.000000) SELECT count(*) AS count_all FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 2)) 
344
+ UserGroup Columns (0.016000) SHOW FIELDS FROM user_groups
345
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 2) 
346
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 2) 
347
+ Group Load (0.000000) SELECT * FROM groups WHERE (groups.`id` = 3) 
348
+ SQL (0.000000) ROLLBACK
349
+ SQL (0.000000) BEGIN
350
+ User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 4) 
351
+ Group Load (0.015000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 4)) 
352
+ User Load (0.000000) SELECT * FROM users WHERE (users.`full_name` = 'Jane Doe Nested') LIMIT 1
353
+ SQL (0.000000) SELECT count(*) AS count_all FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 3)) 
354
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 5) 
355
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 5) 
356
+ Group Load (0.000000) SELECT * FROM groups WHERE (groups.`id` = 30) 
357
+ SQL (0.000000) ROLLBACK
358
+ SQL (0.000000) SET SQL_AUTO_IS_NULL=0
359
+ SQL (0.000000) BEGIN
360
+ SQL (0.000000) ROLLBACK
361
+ SQL (0.000000) BEGIN
362
+ SQL (0.000000) ROLLBACK
363
+ SQL (0.000000) BEGIN
364
+ NestedChild Columns (0.000000) SHOW FIELDS FROM nested_children
365
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 1) 
366
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`field` = 3) LIMIT 1
367
+ SQL (0.000000) ROLLBACK
368
+ SQL (0.000000) BEGIN
369
+ NestedParent Columns (0.015000) SHOW FIELDS FROM nested_parents
370
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 4) 
371
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 1) 
372
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 3) 
373
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 2) 
374
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`field` = 1) LIMIT 1
375
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 4) 
376
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`field` = 1) LIMIT 1
377
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.nested_parent_id = 4) 
378
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.nested_child_id = 2) 
379
+ InnerChild Columns (0.000000) SHOW FIELDS FROM inner_children
380
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 2) 
381
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`field` = 1) LIMIT 1
382
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`id` = 3) 
383
+ NestedChild Load (0.000000) SELECT * FROM nested_children WHERE (nested_children.`id` = 3) 
384
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.`id` = 1) 
385
+ InnerChild Load (0.000000) SELECT * FROM inner_children WHERE (inner_children.`field` = 3) LIMIT 1
386
+ NestedParent Load (0.000000) SELECT * FROM nested_parents WHERE (nested_parents.inner_child_id = 1) 
387
+ SQL (0.000000) ROLLBACK
388
+ SQL (0.000000) BEGIN
389
+ SQL (0.000000) ROLLBACK
390
+ SQL (0.000000) BEGIN
85
391
  SQL (0.000000) ROLLBACK
392
+ SQL (0.000000) BEGIN
393
+ User Columns (0.000000) SHOW FIELDS FROM users
394
+ User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 1) 
395
+ Group Load (0.000000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 1)) 
396
+ Group Columns (0.000000) SHOW FIELDS FROM groups
397
+ User Load (0.000000) SELECT * FROM users WHERE (users.`full_name` = 'Jane Doe') LIMIT 1
398
+ SQL (0.000000) SELECT count(*) AS count_all FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 2)) 
399
+ UserGroup Columns (0.015000) SHOW FIELDS FROM user_groups
400
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 2) 
401
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 2) 
402
+ Group Load (0.000000) SELECT * FROM groups WHERE (groups.`id` = 3) 
403
+ SQL (0.000000) ROLLBACK
404
+ SQL (0.000000) BEGIN
405
+ User Load (0.000000) SELECT * FROM users WHERE (users.`id` = 4) 
406
+ Group Load (0.000000) SELECT groups.* FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 4)) 
407
+ User Load (0.000000) SELECT * FROM users WHERE (users.`full_name` = 'Jane Doe Nested') LIMIT 1
408
+ SQL (0.000000) SELECT count(*) AS count_all FROM groups INNER JOIN user_groups ON groups.id = user_groups.group_id WHERE ((user_groups.user_id = 3)) 
409
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 5) 
410
+ UserGroup Load (0.000000) SELECT * FROM user_groups WHERE (user_groups.`id` = 5) 
411
+ Group Load (0.000000) SELECT * FROM groups WHERE (groups.`id` = 30) 
412
+ SQL (0.000000) ROLLBACK
@@ -1,3 +1,4 @@
1
1
  admin_group:
2
- name: administrators
2
+ id: 3
3
+ name: Administrators
3
4
 
@@ -1,20 +1,28 @@
1
- # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
- bob:
3
- login: bob
4
- groups: admin_group
5
-
6
- jane:
7
- id: 3
8
- login: jane
9
- groups:
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ # These are the fixtures used in the README examples
4
+ john_doe:
5
+ full_name: John Doe
6
+ groups: admin_group
7
+
8
+ jane_doe:
9
+ full_name: Jane Doe
10
+ groups:
10
11
  - admin_group
11
- - workers:
12
- name: worker bees
13
-
14
- samantha:
15
- login: sam
16
- groups:
17
- movers:
18
- name: movers
19
- shakers:
20
- name: shakers
12
+ - worker_group:
13
+ name: Workers
14
+
15
+ # These I renamed so as to not conflict, but they should produce the
16
+ # same fixtures as above
17
+ john_doe_n:
18
+ full_name: John Doe Nested
19
+ groups:
20
+ admin_group_n:
21
+ id: 30
22
+ name: Administrators Nested
23
+ users:
24
+ jane_doe_n:
25
+ full_name: Jane Doe Nested
26
+ groups:
27
+ worker_group_n:
28
+ name: Workers Nested
@@ -4,9 +4,30 @@ class UserTest < Test::Unit::TestCase
4
4
  fixtures :users, :groups, :user_groups
5
5
 
6
6
  def test_joinfix
7
- assert_equal "administrators", users(:bob).groups.first.name
8
- assert_equal 2, User.find_by_login("jane").groups.count
9
- assert_equal 3, UserGroup.find(user_groups(:jane_workers).id).user.id
10
- assert_equal users(:samantha), User.find_by_login("sam").groups.find_by_name("movers").users.first
7
+ assert_equal "Administrators", users(:john_doe).groups.first.name
8
+ assert_equal 2, User.find_by_full_name("Jane Doe").groups.count
9
+ assert_equal 3, UserGroup.find(user_groups(:admin_group_jane_doe).id).group.id
10
+ end
11
+
12
+ def test_nested_joinfix
13
+ assert_equal "Administrators Nested", users(:john_doe_n).groups.first.name
14
+ assert_equal 2, User.find_by_full_name("Jane Doe Nested").groups.count
15
+ assert_equal 30, UserGroup.find(user_groups(:admin_group_n_jane_doe_n).id).group.id
16
+ end
17
+
18
+ def test_associations
19
+ active_record_class = User
20
+ a = active_record_class.reflect_on_association(:groups)
21
+ assert_equal :has_many, a.macro
22
+ assert_equal({:through => :user_groups}, a.options )
23
+
24
+ assert_equal User.reflect_on_association(:user_groups), a.through_reflection
25
+ assert_equal UserGroup.reflect_on_association(:group), a.source_reflection
26
+
27
+ assert_equal "user_groups", a.through_reflection.table_name
28
+ assert_equal "user_id", a.through_reflection.primary_key_name
29
+
30
+ assert_equal "groups", a.source_reflection.table_name
31
+ assert_equal "group_id", a.source_reflection.primary_key_name
11
32
  end
12
33
  end
@@ -57,5 +57,21 @@ child_two:
57
57
  id: 2
58
58
  hm_parent_id: 1
59
59
  field: two})
60
+ end
61
+
62
+ def test_error_for_bad_yaml
63
+ error_test(NoEntryNameError) do
64
+ setup_fixtures(
65
+ :hm_parents => %Q{
66
+ parent_entry:
67
+ id: 1
68
+ field: parent value
69
+ hm_children:
70
+ - child_one:
71
+ field: one
72
+ - child_two:
73
+ field: two},
74
+ :hm_children => %Q{})
75
+ end
60
76
  end
61
77
  end