modulate 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Modulate
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  class Account < ActiveRecord::Base
2
2
  modulate
3
3
 
4
+ attr_accessible :modulate_documents_attributes
4
5
 
5
6
  end
@@ -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
@@ -246,3 +246,117 @@ Processing by AccountsController#index as HTML
246
246
  Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` 
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
+  (0.3ms) BEGIN
251
+ SQL (2.2ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 17:55:38', 'test_account', '2013-03-27 17:55:38')
252
+  (0.4ms) COMMIT
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
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 31 LIMIT 1
257
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 31 AND `modulate_documents`.`attachable_type` = 'Account'
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
+ Account Load (0.3ms) 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
+  (0.2ms) BEGIN
269
+ SQL (2.3ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 17:58:06', 'test_account', '2013-03-27 17:58:06')
270
+  (0.4ms) COMMIT
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
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 32 LIMIT 1
275
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 32 AND `modulate_documents`.`attachable_type` = 'Account'
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
+ Account Load (0.3ms) 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
+  (0.1ms) BEGIN
287
+ SQL (2.2ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 17:58:34', 'test_account', '2013-03-27 17:58:34')
288
+  (0.4ms) COMMIT
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
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 33 LIMIT 1
293
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 33 AND `modulate_documents`.`attachable_type` = 'Account'
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
+ Account Load (0.4ms) 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
+  (0.1ms) BEGIN
305
+ SQL (2.3ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 17:59:22', 'test_account', '2013-03-27 17:59:22')
306
+  (0.4ms) COMMIT
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
+ Account Load (0.4ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 34 LIMIT 1
311
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 34 AND `modulate_documents`.`attachable_type` = 'Account'
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
+ Account Load (0.4ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 34 LIMIT 1
320
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 34 AND `modulate_documents`.`attachable_type` = 'Account'
321
+  (0.1ms) BEGIN
322
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 34 LIMIT 1
323
+ Modulate::Document Exists (0.3ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '34-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
324
+ SQL (0.3ms) INSERT 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')
325
+  (0.4ms) 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
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` 
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
+  (0.4ms) BEGIN
335
+ SQL (2.2ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 17:59:49', 'test_account', '2013-03-27 17:59:49')
336
+  (0.4ms) COMMIT
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
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 35 LIMIT 1
341
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 35 AND `modulate_documents`.`attachable_type` = 'Account'
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
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 35 LIMIT 1
350
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 35 AND `modulate_documents`.`attachable_type` = 'Account'
351
+  (0.1ms) BEGIN
352
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 35 LIMIT 1
353
+ Modulate::Document Exists (0.4ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '35-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
354
+ SQL (0.3ms) INSERT 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')
355
+  (0.4ms) 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
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` 
361
+ Rendered accounts/index.html.haml within layouts/application (1.2ms)
362
+ Completed 200 OK in 11ms (Views: 4.7ms | ActiveRecord: 0.3ms)
@@ -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.3
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: -3121422691208428004
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: -3121422691208428004
301
+ hash: -3947230191988836994
302
302
  requirements: []
303
303
  rubyforge_project:
304
304
  rubygems_version: 1.8.24