modulate 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/modulate/relation.rb +0 -1
- data/lib/modulate/version.rb +1 -1
- data/spec/dummy/app/models/account.rb +1 -0
- data/spec/dummy/log/development.log +2 -0
- data/spec/dummy/log/test.log +114 -0
- data/spec/modulate_spec.rb +0 -5
- metadata +3 -3
data/lib/modulate/relation.rb
CHANGED
@@ -3,7 +3,6 @@ module Modulate::Relation
|
|
3
3
|
def modulate(name=:modulate_documents, options={})
|
4
4
|
has_many name, {as: :attachable, class_name: "Modulate::Document"}.reverse_merge(options)
|
5
5
|
accepts_nested_attributes_for name
|
6
|
-
attr_accessible :"#{name}_attributes"
|
7
6
|
attr_accessor :"#{Modulate.configuration.user_method}" unless Modulate.configuration.user_method == nil
|
8
7
|
end
|
9
8
|
|
data/lib/modulate/version.rb
CHANGED
@@ -3856,3 +3856,5 @@ Served asset /jquery_ujs.js - 304 Not Modified (0ms)
|
|
3856
3856
|
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-03-27 08:10:55 -0400
|
3857
3857
|
Served asset /application.js - 304 Not Modified (1ms)
|
3858
3858
|
Connecting to database specified by database.yml
|
3859
|
+
Connecting to database specified by database.yml
|
3860
|
+
Connecting to database specified by database.yml
|
data/spec/dummy/log/test.log
CHANGED
@@ -246,3 +246,117 @@ Processing by AccountsController#index as HTML
|
|
246
246
|
[1m[36mAccount Load (0.3ms)[0m [1mSELECT `accounts`.* FROM `accounts` [0m
|
247
247
|
Rendered accounts/index.html.haml within layouts/application (1.2ms)
|
248
248
|
Completed 200 OK in 10ms (Views: 4.7ms | ActiveRecord: 0.3ms)
|
249
|
+
Connecting to database specified by database.yml
|
250
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
251
|
+
[1m[35mSQL (2.2ms)[0m INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 17:55:38', 'test_account', '2013-03-27 17:55:38')
|
252
|
+
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
253
|
+
Started GET "/accounts/31" for 127.0.0.1 at 2013-03-27 13:55:38 -0400
|
254
|
+
Processing by AccountsController#show as HTML
|
255
|
+
Parameters: {"id"=>"31"}
|
256
|
+
[1m[35mAccount Load (0.3ms)[0m SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 31 LIMIT 1
|
257
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 31 AND `modulate_documents`.`attachable_type` = 'Account'[0m
|
258
|
+
Rendered accounts/_modulate_account_documents.html.haml (61.6ms)
|
259
|
+
Rendered accounts/_modulate_attachments.html.haml (362.0ms)
|
260
|
+
Rendered accounts/show.html.erb within layouts/application (374.3ms)
|
261
|
+
Completed 200 OK in 462ms (Views: 450.1ms | ActiveRecord: 2.8ms)
|
262
|
+
Started PUT "/accounts/31" for 127.0.0.1 at 2013-03-27 13:55:39 -0400
|
263
|
+
Processing by AccountsController#update as HTML
|
264
|
+
Parameters: {"utf8"=>"✓", "account"=>{"modulate_documents_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007ffd427d6260 @original_filename="test.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"account[modulate_documents_attributes][][attachment]\"; filename=\"test.txt\"\r\nContent-Type: text/plain\r\nContent-Length: 25\r\n", @tempfile=#<File:/var/folders/lb/j1c12jc524zfb75l84v94qr40000gn/T/RackMultipart20130327-91529-1gvbmnd>>}]}, "button"=>"", "id"=>"31"}
|
265
|
+
[1m[35mAccount Load (0.3ms)[0m SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 31 LIMIT 1
|
266
|
+
Completed 500 Internal Server Error in 3ms
|
267
|
+
Connecting to database specified by database.yml
|
268
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
269
|
+
[1m[35mSQL (2.3ms)[0m INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 17:58:06', 'test_account', '2013-03-27 17:58:06')
|
270
|
+
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
271
|
+
Started GET "/accounts/32" for 127.0.0.1 at 2013-03-27 13:58:06 -0400
|
272
|
+
Processing by AccountsController#show as HTML
|
273
|
+
Parameters: {"id"=>"32"}
|
274
|
+
[1m[35mAccount Load (0.3ms)[0m SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 32 LIMIT 1
|
275
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 32 AND `modulate_documents`.`attachable_type` = 'Account'[0m
|
276
|
+
Rendered accounts/_modulate_account_documents.html.haml (108.9ms)
|
277
|
+
Rendered accounts/_modulate_attachments.html.haml (276.9ms)
|
278
|
+
Rendered accounts/show.html.erb within layouts/application (287.1ms)
|
279
|
+
Completed 200 OK in 313ms (Views: 304.1ms | ActiveRecord: 3.0ms)
|
280
|
+
Started PUT "/accounts/32" for 127.0.0.1 at 2013-03-27 13:58:06 -0400
|
281
|
+
Processing by AccountsController#update as HTML
|
282
|
+
Parameters: {"utf8"=>"✓", "account"=>{"modulate_documents_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007f8e60d9a0f8 @original_filename="test.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"account[modulate_documents_attributes][][attachment]\"; filename=\"test.txt\"\r\nContent-Type: text/plain\r\nContent-Length: 25\r\n", @tempfile=#<File:/var/folders/lb/j1c12jc524zfb75l84v94qr40000gn/T/RackMultipart20130327-91616-1wkvqug>>}]}, "button"=>"", "id"=>"32"}
|
283
|
+
[1m[35mAccount Load (0.3ms)[0m SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 32 LIMIT 1
|
284
|
+
Completed 500 Internal Server Error in 3ms
|
285
|
+
Connecting to database specified by database.yml
|
286
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
287
|
+
[1m[35mSQL (2.2ms)[0m INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 17:58:34', 'test_account', '2013-03-27 17:58:34')
|
288
|
+
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
289
|
+
Started GET "/accounts/33" for 127.0.0.1 at 2013-03-27 13:58:35 -0400
|
290
|
+
Processing by AccountsController#show as HTML
|
291
|
+
Parameters: {"id"=>"33"}
|
292
|
+
[1m[35mAccount Load (0.3ms)[0m SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 33 LIMIT 1
|
293
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 33 AND `modulate_documents`.`attachable_type` = 'Account'[0m
|
294
|
+
Rendered accounts/_modulate_account_documents.html.haml (105.5ms)
|
295
|
+
Rendered accounts/_modulate_attachments.html.haml (274.2ms)
|
296
|
+
Rendered accounts/show.html.erb within layouts/application (283.2ms)
|
297
|
+
Completed 200 OK in 309ms (Views: 300.2ms | ActiveRecord: 3.1ms)
|
298
|
+
Started PUT "/accounts/33" for 127.0.0.1 at 2013-03-27 13:58:35 -0400
|
299
|
+
Processing by AccountsController#update as HTML
|
300
|
+
Parameters: {"utf8"=>"✓", "account"=>{"modulate_documents_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007f9de95ef770 @original_filename="test.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"account[modulate_documents_attributes][][attachment]\"; filename=\"test.txt\"\r\nContent-Type: text/plain\r\nContent-Length: 25\r\n", @tempfile=#<File:/var/folders/lb/j1c12jc524zfb75l84v94qr40000gn/T/RackMultipart20130327-91649-1kyitfy>>}]}, "button"=>"", "id"=>"33"}
|
301
|
+
[1m[35mAccount Load (0.4ms)[0m SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 33 LIMIT 1
|
302
|
+
Completed 500 Internal Server Error in 3ms
|
303
|
+
Connecting to database specified by database.yml
|
304
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
305
|
+
[1m[35mSQL (2.3ms)[0m INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 17:59:22', 'test_account', '2013-03-27 17:59:22')
|
306
|
+
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
307
|
+
Started GET "/accounts/34" for 127.0.0.1 at 2013-03-27 13:59:22 -0400
|
308
|
+
Processing by AccountsController#show as HTML
|
309
|
+
Parameters: {"id"=>"34"}
|
310
|
+
[1m[35mAccount Load (0.4ms)[0m SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 34 LIMIT 1
|
311
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 34 AND `modulate_documents`.`attachable_type` = 'Account'[0m
|
312
|
+
Rendered accounts/_modulate_account_documents.html.haml (106.6ms)
|
313
|
+
Rendered accounts/_modulate_attachments.html.haml (284.8ms)
|
314
|
+
Rendered accounts/show.html.erb within layouts/application (293.8ms)
|
315
|
+
Completed 200 OK in 372ms (Views: 362.0ms | ActiveRecord: 3.2ms)
|
316
|
+
Started PUT "/accounts/34" for 127.0.0.1 at 2013-03-27 13:59:23 -0400
|
317
|
+
Processing by AccountsController#update as HTML
|
318
|
+
Parameters: {"utf8"=>"✓", "account"=>{"modulate_documents_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007fabf9d93350 @original_filename="test.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"account[modulate_documents_attributes][][attachment]\"; filename=\"test.txt\"\r\nContent-Type: text/plain\r\nContent-Length: 25\r\n", @tempfile=#<File:/var/folders/lb/j1c12jc524zfb75l84v94qr40000gn/T/RackMultipart20130327-91689-rd05i2>>}]}, "button"=>"", "id"=>"34"}
|
319
|
+
[1m[35mAccount Load (0.4ms)[0m SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 34 LIMIT 1
|
320
|
+
[1m[36mModulate::Document Load (0.3ms)[0m [1mSELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 34 AND `modulate_documents`.`attachable_type` = 'Account'[0m
|
321
|
+
[1m[35m (0.1ms)[0m BEGIN
|
322
|
+
[1m[36mCACHE (0.0ms)[0m [1mSELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 34 LIMIT 1[0m
|
323
|
+
[1m[35mModulate::Document Exists (0.3ms)[0m SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '34-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
|
324
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO `modulate_documents` (`attachable_id`, `attachable_type`, `attached_by_id`, `attachment`, `bucket`, `content_type`, `created_at`, `filename`, `key`, `label`, `public`, `updated_at`) VALUES (34, 'Account', 1, '34-test.txt', 'Dummy::Account', 'text/plain', '2013-03-27 17:59:23', 'test.txt', '34-test.txt', NULL, 0, '2013-03-27 17:59:23')[0m
|
325
|
+
[1m[35m (0.4ms)[0m COMMIT
|
326
|
+
Redirected to http://www.example.com/accounts
|
327
|
+
Completed 302 Found in 127ms (ActiveRecord: 1.8ms)
|
328
|
+
Started GET "/accounts" for 127.0.0.1 at 2013-03-27 13:59:23 -0400
|
329
|
+
Processing by AccountsController#index as HTML
|
330
|
+
[1m[36mAccount Load (0.3ms)[0m [1mSELECT `accounts`.* FROM `accounts` [0m
|
331
|
+
Rendered accounts/index.html.haml within layouts/application (1.2ms)
|
332
|
+
Completed 200 OK in 11ms (Views: 4.8ms | ActiveRecord: 0.3ms)
|
333
|
+
Connecting to database specified by database.yml
|
334
|
+
[1m[36m (0.4ms)[0m [1mBEGIN[0m
|
335
|
+
[1m[35mSQL (2.2ms)[0m INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 17:59:49', 'test_account', '2013-03-27 17:59:49')
|
336
|
+
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
337
|
+
Started GET "/accounts/35" for 127.0.0.1 at 2013-03-27 13:59:49 -0400
|
338
|
+
Processing by AccountsController#show as HTML
|
339
|
+
Parameters: {"id"=>"35"}
|
340
|
+
[1m[35mAccount Load (0.3ms)[0m SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 35 LIMIT 1
|
341
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 35 AND `modulate_documents`.`attachable_type` = 'Account'[0m
|
342
|
+
Rendered accounts/_modulate_account_documents.html.haml (54.4ms)
|
343
|
+
Rendered accounts/_modulate_attachments.html.haml (278.0ms)
|
344
|
+
Rendered accounts/show.html.erb within layouts/application (287.1ms)
|
345
|
+
Completed 200 OK in 362ms (Views: 353.1ms | ActiveRecord: 3.0ms)
|
346
|
+
Started PUT "/accounts/35" for 127.0.0.1 at 2013-03-27 13:59:50 -0400
|
347
|
+
Processing by AccountsController#update as HTML
|
348
|
+
Parameters: {"utf8"=>"✓", "account"=>{"modulate_documents_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007f92353fbc30 @original_filename="test.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"account[modulate_documents_attributes][][attachment]\"; filename=\"test.txt\"\r\nContent-Type: text/plain\r\nContent-Length: 25\r\n", @tempfile=#<File:/var/folders/lb/j1c12jc524zfb75l84v94qr40000gn/T/RackMultipart20130327-91721-n9w6jk>>}]}, "button"=>"", "id"=>"35"}
|
349
|
+
[1m[35mAccount Load (0.3ms)[0m SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 35 LIMIT 1
|
350
|
+
[1m[36mModulate::Document Load (0.3ms)[0m [1mSELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 35 AND `modulate_documents`.`attachable_type` = 'Account'[0m
|
351
|
+
[1m[35m (0.1ms)[0m BEGIN
|
352
|
+
[1m[36mCACHE (0.0ms)[0m [1mSELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 35 LIMIT 1[0m
|
353
|
+
[1m[35mModulate::Document Exists (0.4ms)[0m SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '35-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
|
354
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO `modulate_documents` (`attachable_id`, `attachable_type`, `attached_by_id`, `attachment`, `bucket`, `content_type`, `created_at`, `filename`, `key`, `label`, `public`, `updated_at`) VALUES (35, 'Account', 1, '35-test.txt', 'Dummy::Account', 'text/plain', '2013-03-27 17:59:50', 'test.txt', '35-test.txt', NULL, 0, '2013-03-27 17:59:50')[0m
|
355
|
+
[1m[35m (0.4ms)[0m COMMIT
|
356
|
+
Redirected to http://www.example.com/accounts
|
357
|
+
Completed 302 Found in 117ms (ActiveRecord: 1.8ms)
|
358
|
+
Started GET "/accounts" for 127.0.0.1 at 2013-03-27 13:59:50 -0400
|
359
|
+
Processing by AccountsController#index as HTML
|
360
|
+
[1m[36mAccount Load (0.3ms)[0m [1mSELECT `accounts`.* FROM `accounts` [0m
|
361
|
+
Rendered accounts/index.html.haml within layouts/application (1.2ms)
|
362
|
+
Completed 200 OK in 11ms (Views: 4.7ms | ActiveRecord: 0.3ms)
|
data/spec/modulate_spec.rb
CHANGED
@@ -20,11 +20,6 @@ describe Modulate do
|
|
20
20
|
Account.modulate
|
21
21
|
end
|
22
22
|
|
23
|
-
it "adds attr_accessible for document model to each model that calls it" do
|
24
|
-
Account.should_receive(:attr_accessible).with(:modulate_documents_attributes)
|
25
|
-
Account.modulate
|
26
|
-
end
|
27
|
-
|
28
23
|
context "when no user_method is set" do
|
29
24
|
|
30
25
|
it "adds does not add a user_method attr_accessor to each model that calls it" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modulate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -289,7 +289,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
289
289
|
version: '0'
|
290
290
|
segments:
|
291
291
|
- 0
|
292
|
-
hash: -
|
292
|
+
hash: -3947230191988836994
|
293
293
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
294
294
|
none: false
|
295
295
|
requirements:
|
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
298
298
|
version: '0'
|
299
299
|
segments:
|
300
300
|
- 0
|
301
|
-
hash: -
|
301
|
+
hash: -3947230191988836994
|
302
302
|
requirements: []
|
303
303
|
rubyforge_project:
|
304
304
|
rubygems_version: 1.8.24
|