disclaimer 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@ module Disclaimer
4
4
 
5
5
  before_save :underscore_name
6
6
 
7
- has_many :segment_holders, :uniq => true
7
+ has_many :segment_holders, :uniq => true, :order => 'position'
8
8
  has_many :segments, :through => :segment_holders, :uniq => true
9
9
  accepts_nested_attributes_for :segments
10
10
 
@@ -35,7 +35,23 @@ module Disclaimer
35
35
  def act_as_list_methods
36
36
  @act_as_list_methods ||= ActiveRecord::Acts::List::InstanceMethods.instance_methods
37
37
  end
38
-
38
+
39
+ # This method, together with method missing, is used to allow segments
40
+ # to be ordered within a document. It allows an acts_as_list method to be
41
+ # passed to the segment_holder holding a segment, so as to alter its position.
42
+ #
43
+ # For example:
44
+ # document.move_to_top document.segments.last
45
+ #
46
+ # will move the last segment so that it becomes the first within
47
+ # document.segments.
48
+ #
49
+ #
50
+ # The syntax is:
51
+ #
52
+ # document.<acts_as_list_method> <the_segment_to_be_moved>
53
+ #
54
+ # The segment must already belong to the document
39
55
  def modify_via_segment_holder_acts_as_list_method(method, segment)
40
56
  segment_holder = segment_holder_for(segment)
41
57
  raise segment_not_associated_message(method, segment) unless segment_holder
@@ -1,9 +1,14 @@
1
1
  module Disclaimer
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
4
4
 
5
5
  # History
6
6
  #
7
+ # 0.1.1 - Improves way segments are ordered within documents
8
+ # ----------------------------------------------------------
9
+ # Segment position should now respect segment_holder position.
10
+ # Also added seeds to test/dummy
11
+ #
7
12
  # 0.1.0 - Moves app to beta
8
13
  # -------------------------
9
14
  # Makes app ready for beta release
@@ -0,0 +1,5 @@
1
+ require 'dibber'
2
+
3
+ Dibber::Seeder.seed('disclaimer/documents')
4
+
5
+ puts Dibber::Seeder.report
@@ -0,0 +1,4 @@
1
+ demo:
2
+ title: A disclaimer
3
+ header: This is a disclaimer.
4
+ footer:
Binary file
@@ -21,3 +21,443 @@ Connecting to database specified by database.yml
21
21
   (157.9ms) CREATE TABLE "disclaimer_segments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "title" varchar(255), "body" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
22
22
   (3.1ms) SELECT version FROM "schema_migrations"
23
23
   (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
24
+
25
+
26
+ Started GET "/" for 127.0.0.1 at 2013-09-13 14:40:30 +0100
27
+ Connecting to database specified by database.yml
28
+ Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1
29
+ Processing by SampleController#index as HTML
30
+ No disclaimer displayed as unable to find Disclaimer::Document with name 'nil'
31
+ Rendered sample/index.html.erb within layouts/application (9.6ms)
32
+ Compiled sample.css (0ms) (pid 21901)
33
+ Compiled application.css (40ms) (pid 21901)
34
+ Completed 200 OK in 90ms (Views: 89.3ms | ActiveRecord: 0.0ms)
35
+
36
+
37
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-13 14:40:32 +0100
38
+ Served asset /application.css - 200 OK (13ms)
39
+
40
+
41
+ Started GET "/assets/sample.css?body=1" for 127.0.0.1 at 2013-09-13 14:40:32 +0100
42
+ Served asset /sample.css - 200 OK (10ms)
43
+
44
+
45
+ Started GET "/sample" for 127.0.0.1 at 2013-09-13 14:40:58 +0100
46
+ Processing by SampleController#index as HTML
47
+ No disclaimer displayed as unable to find Disclaimer::Document with name 'nil'
48
+ Rendered sample/index.html.erb within layouts/application (0.2ms)
49
+ Completed 200 OK in 10ms (Views: 7.2ms | ActiveRecord: 0.0ms)
50
+
51
+
52
+ Started GET "/" for 127.0.0.1 at 2013-09-13 14:41:06 +0100
53
+ Processing by SampleController#index as HTML
54
+ No disclaimer displayed as unable to find Disclaimer::Document with name 'nil'
55
+ Rendered sample/index.html.erb within layouts/application (0.1ms)
56
+ Completed 200 OK in 9ms (Views: 8.4ms | ActiveRecord: 0.0ms)
57
+
58
+
59
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-13 14:41:07 +0100
60
+ Served asset /application.css - 304 Not Modified (8ms)
61
+
62
+
63
+ Started GET "/assets/sample.css?body=1" for 127.0.0.1 at 2013-09-13 14:41:07 +0100
64
+ Served asset /sample.css - 304 Not Modified (0ms)
65
+
66
+
67
+ Started GET "/" for 127.0.0.1 at 2013-09-13 14:41:47 +0100
68
+ Processing by SampleController#index as HTML
69
+ No disclaimer displayed as unable to find Disclaimer::Document with name 'nil'
70
+ Rendered sample/index.html.erb within layouts/application (0.1ms)
71
+ Completed 200 OK in 9ms (Views: 8.3ms | ActiveRecord: 0.0ms)
72
+
73
+
74
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-13 14:41:47 +0100
75
+ Served asset /application.css - 200 OK (5ms)
76
+
77
+
78
+ Started GET "/assets/sample.css?body=1" for 127.0.0.1 at 2013-09-13 14:41:47 +0100
79
+ Served asset /sample.css - 200 OK (0ms)
80
+
81
+
82
+ Started GET "/sample" for 127.0.0.1 at 2013-09-13 14:41:58 +0100
83
+ Processing by SampleController#index as HTML
84
+ No disclaimer displayed as unable to find Disclaimer::Document with name 'nil'
85
+ Rendered sample/index.html.erb within layouts/application (0.1ms)
86
+ Completed 200 OK in 9ms (Views: 9.0ms | ActiveRecord: 0.0ms)
87
+
88
+
89
+ Started GET "/admin" for 127.0.0.1 at 2013-09-13 14:42:33 +0100
90
+
91
+ ActionController::RoutingError (No route matches [GET] "/admin"):
92
+ actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
93
+ actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
94
+ railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app'
95
+ railties (3.2.8) lib/rails/rack/logger.rb:16:in `call'
96
+ actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call'
97
+ rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
98
+ rack (1.4.1) lib/rack/runtime.rb:17:in `call'
99
+ activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
100
+ rack (1.4.1) lib/rack/lock.rb:15:in `call'
101
+ actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in `call'
102
+ railties (3.2.8) lib/rails/engine.rb:479:in `call'
103
+ railties (3.2.8) lib/rails/application.rb:223:in `call'
104
+ rack (1.4.1) lib/rack/content_length.rb:14:in `call'
105
+ railties (3.2.8) lib/rails/rack/log_tailer.rb:17:in `call'
106
+ rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
107
+ /home/rob/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
108
+ /home/rob/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
109
+ /home/rob/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
110
+
111
+
112
+ Rendered /home/rob/.rvm/gems/ruby-1.9.3-p448@disclaimer/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (3.8ms)
113
+
114
+
115
+ Started GET "/" for 127.0.0.1 at 2013-09-13 14:42:40 +0100
116
+ Processing by SampleController#index as HTML
117
+ No disclaimer displayed as unable to find Disclaimer::Document with name 'nil'
118
+ Rendered sample/index.html.erb within layouts/application (0.1ms)
119
+ Completed 200 OK in 9ms (Views: 8.4ms | ActiveRecord: 0.0ms)
120
+ Connecting to database specified by database.yml
121
+  (0.3ms) select sqlite_version(*)
122
+  (3.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
123
+  (0.0ms) PRAGMA index_list("disclaimer_documents")
124
+  (0.0ms) PRAGMA index_list("disclaimer_segment_holders")
125
+  (0.0ms) PRAGMA index_list("disclaimer_segments")
126
+ Connecting to database specified by database.yml
127
+  (3.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
128
+
129
+
130
+ Started GET "/" for 127.0.0.1 at 2013-09-13 14:43:15 +0100
131
+ Connecting to database specified by database.yml
132
+ Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1
133
+ Processing by SampleController#index as HTML
134
+ No disclaimer displayed as unable to find Disclaimer::Document with name 'nil'
135
+ Rendered sample/index.html.erb within layouts/application (3.4ms)
136
+ Completed 200 OK in 78ms (Views: 77.3ms | ActiveRecord: 0.0ms)
137
+
138
+
139
+ Started GET "/assets/sample.css?body=1" for 127.0.0.1 at 2013-09-13 14:43:16 +0100
140
+ Served asset /sample.css - 304 Not Modified (1ms)
141
+
142
+
143
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-13 14:43:16 +0100
144
+ Served asset /application.css - 304 Not Modified (29ms)
145
+ Connecting to database specified by database.yml
146
+ Connecting to database specified by database.yml
147
+  (2.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
148
+ Disclaimer::Document Exists (0.3ms) SELECT 1 AS one FROM "disclaimer_documents" LIMIT 1
149
+ Connecting to database specified by database.yml
150
+  (3.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
151
+ Disclaimer::Document Exists (0.2ms) SELECT 1 AS one FROM "disclaimer_documents" LIMIT 1
152
+ Connecting to database specified by database.yml
153
+  (2.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
154
+ Disclaimer::Document Exists (0.2ms) SELECT 1 AS one FROM "disclaimer_documents" LIMIT 1
155
+  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents" 
156
+ Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
157
+  (0.1ms) begin transaction
158
+ SQL (10.6ms) INSERT INTO "disclaimer_documents" ("created_at", "footer", "header", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Fri, 13 Sep 2013 13:52:54 UTC +00:00], ["footer", nil], ["header", "This is a disclaimer."], ["name", "demo"], ["title", "A disclaimer"], ["updated_at", Fri, 13 Sep 2013 13:52:54 UTC +00:00]]
159
+  (240.8ms) commit transaction
160
+ Connecting to database specified by database.yml
161
+  (4.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
162
+ Disclaimer::Document Exists (0.2ms) SELECT 1 AS one FROM "disclaimer_documents" LIMIT 1
163
+ Connecting to database specified by database.yml
164
+  (3.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
165
+  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"
166
+ Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
167
+  (0.2ms) SELECT COUNT(*) FROM "disclaimer_documents"
168
+
169
+
170
+ Started GET "/" for 127.0.0.1 at 2013-09-13 14:53:59 +0100
171
+ Connecting to database specified by database.yml
172
+ Disclaimer::Document Load (1.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1
173
+ CACHE (0.0ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" LIMIT 1
174
+ Processing by SampleController#index as HTML
175
+ Disclaimer::Document Exists (0.3ms) SELECT 1 AS one FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
176
+ Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
177
+ Redirected to http://localhost:3000/disclaimer/documents/demo
178
+ Filter chain halted as #<Proc:0x95d5e2c@/home/rob/web/disclaimer/lib/rails/actionpack/lib/action_controller/base.rb:7> rendered or redirected
179
+ Completed 302 Found in 89ms (ActiveRecord: 0.5ms)
180
+
181
+
182
+ Started GET "/disclaimer/documents/demo" for 127.0.0.1 at 2013-09-13 14:54:00 +0100
183
+ Processing by Disclaimer::DocumentsController#show as HTML
184
+ Parameters: {"id"=>"demo"}
185
+ Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
186
+ Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position
187
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/show.html.erb within layouts/disclaimer/application (136.4ms)
188
+ Compiled disclaimer/documents.css (0ms) (pid 22371)
189
+ Compiled disclaimer/segments.css (0ms) (pid 22371)
190
+ Compiled disclaimer/application.css (39ms) (pid 22371)
191
+ Completed 200 OK in 255ms (Views: 252.0ms | ActiveRecord: 1.3ms)
192
+
193
+
194
+ Started GET "/assets/disclaimer/application.css?body=1" for 127.0.0.1 at 2013-09-13 14:54:00 +0100
195
+ Served asset /disclaimer/application.css - 200 OK (49ms)
196
+
197
+
198
+ Started GET "/assets/disclaimer/documents.css?body=1" for 127.0.0.1 at 2013-09-13 14:54:00 +0100
199
+ Served asset /disclaimer/documents.css - 200 OK (42ms)
200
+
201
+
202
+ Started GET "/assets/disclaimer/segments.css?body=1" for 127.0.0.1 at 2013-09-13 14:54:01 +0100
203
+ Served asset /disclaimer/segments.css - 200 OK (14ms)
204
+
205
+
206
+ Started POST "/disclaimer/documents/demo/accept" for 127.0.0.1 at 2013-09-13 14:54:07 +0100
207
+ Processing by Disclaimer::DocumentsController#accept as HTML
208
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"3AcxZQTHdsVxlb21VlBJp6aLTnsUvsGEh5qbAb1tSgo=", "commit"=>"Accept", "id"=>"demo"}
209
+ Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
210
+ Redirected to http://localhost:3000/
211
+ Completed 302 Found in 1ms (ActiveRecord: 0.2ms)
212
+
213
+
214
+ Started GET "/" for 127.0.0.1 at 2013-09-13 14:54:07 +0100
215
+ Processing by SampleController#index as HTML
216
+ Disclaimer::Document Exists (4.5ms) SELECT 1 AS one FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
217
+ Rendered sample/index.html.erb within layouts/application (0.5ms)
218
+ Completed 200 OK in 28ms (Views: 21.0ms | ActiveRecord: 4.5ms)
219
+
220
+
221
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-13 14:54:08 +0100
222
+ Served asset /application.css - 304 Not Modified (13ms)
223
+
224
+
225
+ Started GET "/assets/sample.css?body=1" for 127.0.0.1 at 2013-09-13 14:54:08 +0100
226
+ Served asset /sample.css - 304 Not Modified (8ms)
227
+
228
+
229
+ Started GET "/sample" for 127.0.0.1 at 2013-09-13 14:55:06 +0100
230
+ Processing by SampleController#index as HTML
231
+ Disclaimer::Document Exists (0.5ms) SELECT 1 AS one FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
232
+ Rendered sample/index.html.erb within layouts/application (0.1ms)
233
+ Completed 200 OK in 12ms (Views: 8.0ms | ActiveRecord: 0.5ms)
234
+
235
+
236
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-13 14:55:07 +0100
237
+ Served asset /application.css - 304 Not Modified (0ms)
238
+
239
+
240
+ Started GET "/assets/sample.css?body=1" for 127.0.0.1 at 2013-09-13 14:55:07 +0100
241
+ Served asset /sample.css - 304 Not Modified (1ms)
242
+
243
+
244
+ Started GET "/" for 127.0.0.1 at 2013-09-13 14:55:28 +0100
245
+ Processing by SampleController#index as HTML
246
+ Disclaimer::Document Exists (0.2ms) SELECT 1 AS one FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
247
+ Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
248
+ Redirected to http://localhost:3000/disclaimer/documents/demo
249
+ Filter chain halted as #<Proc:0x95d5e2c@/home/rob/web/disclaimer/lib/rails/actionpack/lib/action_controller/base.rb:7> rendered or redirected
250
+ Completed 302 Found in 8ms (ActiveRecord: 0.5ms)
251
+
252
+
253
+ Started GET "/disclaimer/documents/demo" for 127.0.0.1 at 2013-09-13 14:55:28 +0100
254
+ Processing by Disclaimer::DocumentsController#show as HTML
255
+ Parameters: {"id"=>"demo"}
256
+ Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
257
+ Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position
258
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/show.html.erb within layouts/disclaimer/application (6.0ms)
259
+ Completed 200 OK in 17ms (Views: 15.0ms | ActiveRecord: 0.5ms)
260
+
261
+
262
+ Started GET "/assets/disclaimer/application.css?body=1" for 127.0.0.1 at 2013-09-13 14:55:29 +0100
263
+ Served asset /disclaimer/application.css - 200 OK (9ms)
264
+
265
+
266
+ Started GET "/assets/disclaimer/documents.css?body=1" for 127.0.0.1 at 2013-09-13 14:55:29 +0100
267
+ Served asset /disclaimer/documents.css - 200 OK (0ms)
268
+
269
+
270
+ Started GET "/assets/disclaimer/segments.css?body=1" for 127.0.0.1 at 2013-09-13 14:55:29 +0100
271
+ Served asset /disclaimer/segments.css - 200 OK (0ms)
272
+
273
+
274
+ Started POST "/disclaimer/documents/demo/accept" for 127.0.0.1 at 2013-09-13 14:55:35 +0100
275
+ Processing by Disclaimer::DocumentsController#accept as HTML
276
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"86r2uWYiX+5Zn8RB6N7bv+EILpneLUOL5HXfX7KbiTE=", "commit"=>"Accept", "id"=>"demo"}
277
+ Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
278
+ Redirected to http://localhost:3000/
279
+ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)
280
+
281
+
282
+ Started GET "/" for 127.0.0.1 at 2013-09-13 14:55:35 +0100
283
+ Processing by SampleController#index as HTML
284
+ Disclaimer::Document Exists (0.2ms) SELECT 1 AS one FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
285
+ Rendered sample/index.html.erb within layouts/application (0.1ms)
286
+ Completed 200 OK in 20ms (Views: 16.9ms | ActiveRecord: 0.2ms)
287
+
288
+
289
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-09-13 14:55:35 +0100
290
+ Served asset /application.css - 304 Not Modified (0ms)
291
+
292
+
293
+ Started GET "/assets/sample.css?body=1" for 127.0.0.1 at 2013-09-13 14:55:35 +0100
294
+ Served asset /sample.css - 304 Not Modified (0ms)
295
+
296
+
297
+ Started GET "/disclaimer/" for 127.0.0.1 at 2013-09-13 14:58:47 +0100
298
+ Connecting to database specified by database.yml
299
+ Processing by Disclaimer::DocumentsController#index as HTML
300
+ Disclaimer::Document Load (0.5ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" 
301
+ Disclaimer::Segment Load (0.4ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position
302
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/index.html.erb within layouts/disclaimer/application (149.4ms)
303
+ Completed 200 OK in 291ms (Views: 200.4ms | ActiveRecord: 10.7ms)
304
+
305
+
306
+ Started GET "/disclaimer/documents/demo/edit" for 127.0.0.1 at 2013-09-13 14:58:56 +0100
307
+ Processing by Disclaimer::DocumentsController#edit as HTML
308
+ Parameters: {"id"=>"demo"}
309
+ Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
310
+ Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"
311
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/new.html.erb within layouts/disclaimer/application (36.8ms)
312
+ Completed 200 OK in 62ms (Views: 58.2ms | ActiveRecord: 0.5ms)
313
+
314
+
315
+ Started GET "/disclaimer/segments" for 127.0.0.1 at 2013-09-13 14:59:09 +0100
316
+ Processing by Disclaimer::SegmentsController#index as HTML
317
+ Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" 
318
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/index.html.erb within layouts/disclaimer/application (12.9ms)
319
+ Completed 200 OK in 31ms (Views: 29.8ms | ActiveRecord: 0.2ms)
320
+
321
+
322
+ Started GET "/disclaimer/segments/new" for 127.0.0.1 at 2013-09-13 14:59:12 +0100
323
+ Processing by Disclaimer::SegmentsController#new as HTML
324
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/new.html.erb within layouts/disclaimer/application (6.0ms)
325
+ Completed 200 OK in 25ms (Views: 19.4ms | ActiveRecord: 0.0ms)
326
+
327
+
328
+ Started POST "/disclaimer/segments" for 127.0.0.1 at 2013-09-13 14:59:32 +0100
329
+ Processing by Disclaimer::SegmentsController#create as HTML
330
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"3AcxZQTHdsVxlb21VlBJp6aLTnsUvsGEh5qbAb1tSgo=", "segment"=>{"name"=>"one", "title"=>"First one", "body"=>"This is some text"}, "commit"=>"Create Segment"}
331
+  (0.1ms) begin transaction
332
+ SQL (26.7ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", "This is some text"], ["created_at", Fri, 13 Sep 2013 13:59:32 UTC +00:00], ["name", "one"], ["title", "First one"], ["updated_at", Fri, 13 Sep 2013 13:59:32 UTC +00:00]]
333
+  (345.6ms) commit transaction
334
+ Redirected to http://localhost:3000/disclaimer/segments/one
335
+ Completed 302 Found in 380ms (ActiveRecord: 372.4ms)
336
+
337
+
338
+ Started GET "/disclaimer/segments/one" for 127.0.0.1 at 2013-09-13 14:59:32 +0100
339
+ Processing by Disclaimer::SegmentsController#show as HTML
340
+ Parameters: {"id"=>"one"}
341
+ Disclaimer::Segment Load (1.0ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'one' LIMIT 1
342
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (1.3ms)
343
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/show.html.erb within layouts/disclaimer/application (8.2ms)
344
+ Completed 200 OK in 27ms (Views: 23.0ms | ActiveRecord: 1.0ms)
345
+
346
+
347
+ Started GET "/disclaimer" for 127.0.0.1 at 2013-09-13 14:59:37 +0100
348
+ Processing by Disclaimer::DocumentsController#index as HTML
349
+ Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents"
350
+ Disclaimer::Segment Load (4.9ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position
351
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/index.html.erb within layouts/disclaimer/application (7.2ms)
352
+ Completed 200 OK in 34ms (Views: 28.1ms | ActiveRecord: 5.2ms)
353
+
354
+
355
+ Started GET "/disclaimer/documents/demo/edit" for 127.0.0.1 at 2013-09-13 14:59:40 +0100
356
+ Processing by Disclaimer::DocumentsController#edit as HTML
357
+ Parameters: {"id"=>"demo"}
358
+ Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
359
+ Disclaimer::Segment Load (0.3ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" 
360
+ Disclaimer::Segment Exists (0.3ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1
361
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/new.html.erb within layouts/disclaimer/application (15.2ms)
362
+ Completed 200 OK in 28ms (Views: 25.8ms | ActiveRecord: 0.8ms)
363
+
364
+
365
+ Started PUT "/disclaimer/documents/demo" for 127.0.0.1 at 2013-09-13 14:59:47 +0100
366
+ Processing by Disclaimer::DocumentsController#update as HTML
367
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"3AcxZQTHdsVxlb21VlBJp6aLTnsUvsGEh5qbAb1tSgo=", "document"=>{"name"=>"demo", "title"=>"A disclaimer", "header"=>"This is a disclaimer.", "segments"=>{"1"=>"on"}, "footer"=>""}, "commit"=>"Update Document", "id"=>"demo"}
368
+ Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
369
+ Disclaimer::Segment Load (0.4ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]
370
+  (0.0ms) begin transaction
371
+ Disclaimer::Segment Load (4.7ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position
372
+ Disclaimer::SegmentHolder Load (0.2ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1
373
+ SQL (4.8ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 13 Sep 2013 13:59:47 UTC +00:00], ["document_id", 1], ["position", 1], ["segment_id", 1], ["updated_at", Fri, 13 Sep 2013 13:59:47 UTC +00:00]]
374
+  (1.6ms) UPDATE "disclaimer_documents" SET "footer" = '', "updated_at" = '2013-09-13 13:59:47.114703' WHERE "disclaimer_documents"."id" = 1
375
+  (187.6ms) commit transaction
376
+ Redirected to http://localhost:3000/disclaimer/documents/demo
377
+ Completed 302 Found in 284ms (ActiveRecord: 199.5ms)
378
+
379
+
380
+ Started GET "/disclaimer/documents/demo" for 127.0.0.1 at 2013-09-13 14:59:47 +0100
381
+ Processing by Disclaimer::DocumentsController#show as HTML
382
+ Parameters: {"id"=>"demo"}
383
+ Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
384
+ Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position
385
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/show.html.erb within layouts/disclaimer/application (6.5ms)
386
+ Completed 200 OK in 29ms (Views: 23.5ms | ActiveRecord: 0.5ms)
387
+
388
+
389
+ Started GET "/disclaimer/segments" for 127.0.0.1 at 2013-09-13 15:00:07 +0100
390
+ Processing by Disclaimer::SegmentsController#index as HTML
391
+ Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" 
392
+ Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_documents"."id" = "disclaimer_segment_holders"."document_id" WHERE "disclaimer_segment_holders"."segment_id" = 1 ORDER BY position
393
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/index.html.erb within layouts/disclaimer/application (15.8ms)
394
+ Completed 200 OK in 27ms (Views: 26.1ms | ActiveRecord: 0.5ms)
395
+
396
+
397
+ Started GET "/disclaimer/segments/new" for 127.0.0.1 at 2013-09-13 15:00:10 +0100
398
+ Processing by Disclaimer::SegmentsController#new as HTML
399
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/new.html.erb within layouts/disclaimer/application (6.0ms)
400
+ Completed 200 OK in 12ms (Views: 11.5ms | ActiveRecord: 0.0ms)
401
+
402
+
403
+ Started POST "/disclaimer/segments" for 127.0.0.1 at 2013-09-13 15:00:21 +0100
404
+ Processing by Disclaimer::SegmentsController#create as HTML
405
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"3AcxZQTHdsVxlb21VlBJp6aLTnsUvsGEh5qbAb1tSgo=", "segment"=>{"name"=>"two", "title"=>"Two", "body"=>"Segment two"}, "commit"=>"Create Segment"}
406
+  (0.1ms) begin transaction
407
+ SQL (1.0ms) INSERT INTO "disclaimer_segments" ("body", "created_at", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", "Segment two"], ["created_at", Fri, 13 Sep 2013 14:00:21 UTC +00:00], ["name", "two"], ["title", "Two"], ["updated_at", Fri, 13 Sep 2013 14:00:21 UTC +00:00]]
408
+  (257.5ms) commit transaction
409
+ Redirected to http://localhost:3000/disclaimer/segments/two
410
+ Completed 302 Found in 262ms (ActiveRecord: 258.6ms)
411
+
412
+
413
+ Started GET "/disclaimer/segments/two" for 127.0.0.1 at 2013-09-13 15:00:21 +0100
414
+ Processing by Disclaimer::SegmentsController#show as HTML
415
+ Parameters: {"id"=>"two"}
416
+ Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."name" = 'two' LIMIT 1
417
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/_segment.html.erb (0.1ms)
418
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/segments/show.html.erb within layouts/disclaimer/application (7.1ms)
419
+ Completed 200 OK in 24ms (Views: 22.5ms | ActiveRecord: 0.2ms)
420
+
421
+
422
+ Started GET "/disclaimer/documents" for 127.0.0.1 at 2013-09-13 15:00:29 +0100
423
+ Processing by Disclaimer::DocumentsController#index as HTML
424
+ Disclaimer::Document Load (0.3ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" 
425
+ Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position
426
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/index.html.erb within layouts/disclaimer/application (16.1ms)
427
+ Completed 200 OK in 27ms (Views: 25.6ms | ActiveRecord: 0.6ms)
428
+
429
+
430
+ Started GET "/disclaimer/documents/demo/edit" for 127.0.0.1 at 2013-09-13 15:00:31 +0100
431
+ Processing by Disclaimer::DocumentsController#edit as HTML
432
+ Parameters: {"id"=>"demo"}
433
+ Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
434
+ Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments"
435
+ Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 1 LIMIT 1
436
+ Disclaimer::Segment Exists (0.2ms) SELECT DISTINCT 1 AS one FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 AND "disclaimer_segments"."id" = 2 LIMIT 1
437
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/new.html.erb within layouts/disclaimer/application (11.2ms)
438
+ Completed 200 OK in 39ms (Views: 32.1ms | ActiveRecord: 0.9ms)
439
+
440
+
441
+ Started PUT "/disclaimer/documents/demo" for 127.0.0.1 at 2013-09-13 15:00:34 +0100
442
+ Processing by Disclaimer::DocumentsController#update as HTML
443
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"3AcxZQTHdsVxlb21VlBJp6aLTnsUvsGEh5qbAb1tSgo=", "document"=>{"name"=>"demo", "title"=>"A disclaimer", "header"=>"This is a disclaimer.", "segments"=>{"1"=>"on", "2"=>"on"}, "footer"=>""}, "commit"=>"Update Document", "id"=>"demo"}
444
+ Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
445
+ Disclaimer::Segment Load (0.2ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "1"]]
446
+ Disclaimer::Segment Load (0.1ms) SELECT "disclaimer_segments".* FROM "disclaimer_segments" WHERE "disclaimer_segments"."id" = ? LIMIT 1 [["id", "2"]]
447
+  (0.0ms) begin transaction
448
+ Disclaimer::Segment Load (5.2ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position
449
+ Disclaimer::SegmentHolder Load (0.1ms) SELECT "disclaimer_segment_holders".* FROM "disclaimer_segment_holders" WHERE ("disclaimer_segment_holders"."document_id" = 1) ORDER BY disclaimer_segment_holders.position DESC LIMIT 1
450
+ SQL (7.3ms) INSERT INTO "disclaimer_segment_holders" ("created_at", "document_id", "position", "segment_id", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 13 Sep 2013 14:00:34 UTC +00:00], ["document_id", 1], ["position", 2], ["segment_id", 2], ["updated_at", Fri, 13 Sep 2013 14:00:34 UTC +00:00]]
451
+  (281.7ms) commit transaction
452
+ Redirected to http://localhost:3000/disclaimer/documents/demo
453
+ Completed 302 Found in 309ms (ActiveRecord: 294.9ms)
454
+
455
+
456
+ Started GET "/disclaimer/documents/demo" for 127.0.0.1 at 2013-09-13 15:00:35 +0100
457
+ Processing by Disclaimer::DocumentsController#show as HTML
458
+ Parameters: {"id"=>"demo"}
459
+ Disclaimer::Document Load (0.2ms) SELECT "disclaimer_documents".* FROM "disclaimer_documents" WHERE "disclaimer_documents"."name" = 'demo' LIMIT 1
460
+ Disclaimer::Segment Load (0.3ms) SELECT DISTINCT "disclaimer_segments".* FROM "disclaimer_segments" INNER JOIN "disclaimer_segment_holders" ON "disclaimer_segments"."id" = "disclaimer_segment_holders"."segment_id" WHERE "disclaimer_segment_holders"."document_id" = 1 ORDER BY position
461
+ Rendered /home/rob/web/disclaimer/app/views/disclaimer/documents/show.html.erb within layouts/disclaimer/application (4.7ms)
462
+ Completed 200 OK in 23ms (Views: 21.1ms | ActiveRecord: 0.5ms)
463
+ Connecting to database specified by database.yml