modulate 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ class Modulate::DocumentsController < Modulate::ApplicationController
2
+
3
+ def destroy
4
+ @doc = Modulate::Document.find(params[:id])
5
+ if @doc.destroy
6
+ redirect_to :back
7
+ end
8
+ end
9
+
10
+ def show
11
+ @doc = Modulate::Document.find(params[:id])
12
+ @file = Modulate::DocumentUploader.new.retrieve_from_store!(@doc.key)
13
+ redirect_to :back
14
+ end
15
+ end
File without changes
data/config/routes.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  Rails.application.routes.draw do
2
2
 
3
- resources :modulate_documents
3
+ namespace :modulate do
4
+ resources :documents
5
+ end
4
6
 
5
7
  end
@@ -16,7 +16,7 @@ class AddModulateDocumentTable < ActiveRecord::Migration
16
16
  z.timestamps
17
17
  end
18
18
 
19
- add_index :modulate_documents, :key, unique: true
19
+ add_index :modulate_documents, [:bucket, :key], unique: true
20
20
 
21
21
  end
22
22
 
@@ -1,3 +1,3 @@
1
1
  module Modulate
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -3876,3 +3876,67 @@ Connecting to database specified by database.yml
3876
3876
  Connecting to database specified by database.yml
3877
3877
  Connecting to database specified by database.yml
3878
3878
  Connecting to database specified by database.yml
3879
+ Connecting to database specified by database.yml
3880
+ Connecting to database specified by database.yml
3881
+ Connecting to database specified by database.yml
3882
+ Connecting to database specified by database.yml
3883
+ Connecting to database specified by database.yml
3884
+ Connecting to database specified by database.yml
3885
+ Connecting to database specified by database.yml
3886
+
3887
+
3888
+ Started GET "/accounts/1" for 127.0.0.1 at 2013-03-28 14:10:01 -0400
3889
+ Processing by AccountsController#show as HTML
3890
+ Parameters: {"id"=>"1"}
3891
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 1 LIMIT 1
3892
+  (0.4ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 1 AND `modulate_documents`.`attachable_type` = 'Account'
3893
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 1 AND `modulate_documents`.`attachable_type` = 'Account'
3894
+ Rendered accounts/_modulate_account_documents.html.haml (266.0ms)
3895
+ Rendered accounts/_modulate_attachments.html.haml (378.0ms)
3896
+ Rendered accounts/show.html.erb within layouts/application (387.7ms)
3897
+ Completed 200 OK in 536ms (Views: 414.7ms | ActiveRecord: 74.9ms)
3898
+
3899
+
3900
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-03-28 14:10:02 -0400
3901
+ Served asset /application.css - 304 Not Modified (8ms)
3902
+
3903
+
3904
+ Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-03-28 14:10:02 -0400
3905
+ Served asset /application.js - 304 Not Modified (9ms)
3906
+
3907
+
3908
+ Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-03-28 14:10:02 -0400
3909
+ Served asset /jquery.js - 304 Not Modified (7ms)
3910
+
3911
+
3912
+ Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2013-03-28 14:10:02 -0400
3913
+ Served asset /jquery_ujs.js - 304 Not Modified (7ms)
3914
+ Connecting to database specified by database.yml
3915
+
3916
+
3917
+ Started GET "/accounts/1" for 127.0.0.1 at 2013-04-01 08:51:39 -0400
3918
+ Processing by AccountsController#show as HTML
3919
+ Parameters: {"id"=>"1"}
3920
+ Account Load (0.4ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 1 LIMIT 1
3921
+  (0.3ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 1 AND `modulate_documents`.`attachable_type` = 'Account'
3922
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 1 AND `modulate_documents`.`attachable_type` = 'Account'
3923
+ Rendered accounts/_modulate_account_documents.html.haml (303.9ms)
3924
+ Rendered accounts/_modulate_attachments.html.haml (446.2ms)
3925
+ Rendered accounts/show.html.erb within layouts/application (481.7ms)
3926
+ Completed 200 OK in 764ms (Views: 577.8ms | ActiveRecord: 81.3ms)
3927
+
3928
+
3929
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-04-01 08:51:40 -0400
3930
+ Served asset /application.css - 200 OK (3ms)
3931
+
3932
+
3933
+ Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-04-01 08:51:40 -0400
3934
+ Served asset /jquery.js - 200 OK (16ms)
3935
+
3936
+
3937
+ Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2013-04-01 08:51:41 -0400
3938
+
3939
+
3940
+ Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-04-01 08:51:41 -0400
3941
+ Served asset /jquery_ujs.js - 200 OK (7ms)
3942
+ Served asset /application.js - 200 OK (9ms)
@@ -454,3 +454,64 @@ Processing by AccountsController#index as HTML
454
454
  Account Load (0.5ms) SELECT `accounts`.* FROM `accounts` 
455
455
  Rendered accounts/index.html.haml within layouts/application (1.2ms)
456
456
  Completed 200 OK in 12ms (Views: 4.8ms | ActiveRecord: 0.5ms)
457
+ Connecting to database specified by database.yml
458
+ Connecting to database specified by database.yml
459
+  (0.1ms) BEGIN
460
+ SQL (2.7ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-28 13:00:33', 'test_account', '2013-03-28 13:00:33')
461
+  (0.4ms) COMMIT
462
+ Started GET "/accounts/43" for 127.0.0.1 at 2013-03-28 09:00:33 -0400
463
+ Processing by AccountsController#show as HTML
464
+ Parameters: {"id"=>"43"}
465
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 43 LIMIT 1
466
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 43 AND `modulate_documents`.`attachable_type` = 'Account'
467
+ Rendered accounts/_modulate_account_documents.html.haml (59.3ms)
468
+ Rendered accounts/_modulate_attachments.html.haml (324.1ms)
469
+ Rendered accounts/show.html.erb within layouts/application (333.0ms)
470
+ Completed 200 OK in 410ms (Views: 399.7ms | ActiveRecord: 3.0ms)
471
+ Started PUT "/accounts/43" for 127.0.0.1 at 2013-03-28 09:00:34 -0400
472
+ Processing by AccountsController#update as HTML
473
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_documents_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007fc5a3ce9918 @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/RackMultipart20130328-1289-18uob9e>>}]}, "button"=>"", "id"=>"43"}
474
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 43 LIMIT 1
475
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 43 AND `modulate_documents`.`attachable_type` = 'Account'
476
+  (0.1ms) BEGIN
477
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 43 LIMIT 1
478
+ Modulate::Document Exists (0.4ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '43-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
479
+ 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 (43, 'Account', 1, '43-test.txt', 'Dummy::Account', 'text/plain', '2013-03-28 13:00:34', 'test.txt', '43-test.txt', NULL, 0, '2013-03-28 13:00:34')
480
+  (0.5ms) COMMIT
481
+ Redirected to http://www.example.com/accounts
482
+ Completed 302 Found in 152ms (ActiveRecord: 1.8ms)
483
+ Started GET "/accounts" for 127.0.0.1 at 2013-03-28 09:00:34 -0400
484
+ Processing by AccountsController#index as HTML
485
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` 
486
+ Rendered accounts/index.html.haml within layouts/application (1.2ms)
487
+ Completed 200 OK in 12ms (Views: 4.8ms | ActiveRecord: 0.3ms)
488
+ Connecting to database specified by database.yml
489
+  (0.1ms) BEGIN
490
+ SQL (2.7ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-28 15:19:55', 'test_account', '2013-03-28 15:19:55')
491
+  (0.3ms) COMMIT
492
+ Started GET "/accounts/44" for 127.0.0.1 at 2013-03-28 11:19:56 -0400
493
+ Processing by AccountsController#show as HTML
494
+ Parameters: {"id"=>"44"}
495
+ Account Load (0.4ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 44 LIMIT 1
496
+  (0.3ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 44 AND `modulate_documents`.`attachable_type` = 'Account'
497
+ Rendered accounts/_modulate_account_documents.html.haml (210.8ms)
498
+ Rendered accounts/_modulate_attachments.html.haml (532.5ms)
499
+ Rendered accounts/show.html.erb within layouts/application (560.1ms)
500
+ Completed 200 OK in 634ms (Views: 586.1ms | ActiveRecord: 31.3ms)
501
+ Started PUT "/accounts/44" for 127.0.0.1 at 2013-03-28 11:19:57 -0400
502
+ Processing by AccountsController#update as HTML
503
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_documents_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007f9d1b745670 @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/RackMultipart20130328-3766-p3ojnh>>}]}, "button"=>"", "id"=>"44"}
504
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 44 LIMIT 1
505
+ Modulate::Document Load (0.4ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 44 AND `modulate_documents`.`attachable_type` = 'Account'
506
+  (0.1ms) BEGIN
507
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 44 LIMIT 1
508
+ Modulate::Document Exists (0.4ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '44-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
509
+ SQL (0.4ms) INSERT INTO `modulate_documents` (`attachable_id`, `attachable_type`, `attached_by_id`, `attachment`, `bucket`, `content_type`, `created_at`, `filename`, `key`, `label`, `public`, `updated_at`) VALUES (44, 'Account', 1, '44-test.txt', 'Dummy::Account', 'text/plain', '2013-03-28 15:19:57', 'test.txt', '44-test.txt', NULL, 0, '2013-03-28 15:19:57')
510
+  (0.5ms) COMMIT
511
+ Redirected to http://www.example.com/accounts
512
+ Completed 302 Found in 162ms (ActiveRecord: 2.1ms)
513
+ Started GET "/accounts" for 127.0.0.1 at 2013-03-28 11:19:57 -0400
514
+ Processing by AccountsController#index as HTML
515
+ Account Load (0.4ms) SELECT `accounts`.* FROM `accounts` 
516
+ Rendered accounts/index.html.haml within layouts/application (1.4ms)
517
+ Completed 200 OK in 14ms (Views: 5.6ms | ActiveRecord: 0.4ms)
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.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-27 00:00:00.000000000 Z
12
+ date: 2013-04-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: carrierwave-riak
@@ -163,8 +163,10 @@ extensions: []
163
163
  extra_rdoc_files: []
164
164
  files:
165
165
  - app/controllers/modulate/application_controller.rb
166
+ - app/controllers/modulate/documents_controller.rb
166
167
  - app/models/modulate/document.rb
167
168
  - app/uploaders/modulate/document_uploader.rb
169
+ - app/views/modulate/documents/show.html.haml
168
170
  - config/routes.rb
169
171
  - db/migrate/20130320174022_add_modulate_document_table.rb
170
172
  - lib/generators/modulate/modulate_generator.rb
@@ -288,7 +290,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
288
290
  version: '0'
289
291
  segments:
290
292
  - 0
291
- hash: -3887787610072244213
293
+ hash: 3555518139713941680
292
294
  required_rubygems_version: !ruby/object:Gem::Requirement
293
295
  none: false
294
296
  requirements:
@@ -297,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
299
  version: '0'
298
300
  segments:
299
301
  - 0
300
- hash: -3887787610072244213
302
+ hash: 3555518139713941680
301
303
  requirements: []
302
304
  rubyforge_project:
303
305
  rubygems_version: 1.8.24