modulate 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. data/lib/generators/modulate/modulate_generator.rb +42 -1
  2. data/lib/generators/modulate/templates/_riak_test_server.yml +8 -0
  3. data/lib/modulate/version.rb +1 -1
  4. data/spec/dummy/app/models/account.rb +1 -1
  5. data/spec/dummy/app/views/accounts/_modulate_attachments.html.haml +2 -2
  6. data/spec/dummy/log/development.log +16 -0
  7. data/spec/dummy/log/test.log +438 -0
  8. data/spec/dummy/public/uploads/tmp/20130405-0937-87271-7051/test.txt +1 -0
  9. data/spec/dummy/public/uploads/tmp/20130405-1000-89304-0382/test.txt +1 -0
  10. data/spec/dummy/public/uploads/tmp/20130405-1004-89439-0962/test.txt +1 -0
  11. data/spec/dummy/public/uploads/tmp/20130405-1056-92011-2291/test.txt +1 -0
  12. data/spec/dummy/public/uploads/tmp/20130405-1101-92040-3866/test.txt +1 -0
  13. data/spec/dummy/public/uploads/tmp/20130405-1103-92315-4868/test.txt +1 -0
  14. data/spec/dummy/public/uploads/tmp/20130405-1104-92379-0419/test.txt +1 -0
  15. data/spec/dummy/spec/spec_helper.rb +29 -0
  16. data/spec/dummy/spec/support/riak_test_server.yml +8 -0
  17. data/spec/dummy/tmp/capybara/capybara-201304051053146722216650.html +45 -0
  18. data/spec/dummy/tmp/capybara/capybara-201304051056491925571097.html +45 -0
  19. data/spec/dummy/tmp/capybara/capybara-201304051057122353305121.html +45 -0
  20. data/spec/dummy/tmp/capybara/capybara-2013040511010831294374.html +45 -0
  21. data/spec/dummy/tmp/capybara/capybara-201304051104006370952070.html +45 -0
  22. data/spec/dummy/tmp/capybara/capybara-201304051104405983646971.html +45 -0
  23. data/spec/features/modulate_spec.rb +1 -1
  24. data/spec/spec_helper.rb +30 -1
  25. data/spec/support/test_server.yml +9 -0
  26. metadata +37 -4
@@ -5,6 +5,8 @@ class ModulateGenerator < Rails::Generators::Base
5
5
 
6
6
  argument :model_name, type: :string, required: true
7
7
 
8
+ class_option :test_server, type: :boolean, default: false, desc: "Install Riak Test Server"
9
+
8
10
  def edit_model
9
11
  line = "class #{model_name.constantize} < ActiveRecord::Base"
10
12
  gsub_file "app/models/#{model_name.underscore}.rb", /(#{Regexp.escape(line)})/mi do |match|
@@ -21,6 +23,14 @@ class ModulateGenerator < Rails::Generators::Base
21
23
  copy_file "_carrierwave.rb", "config/initializers/carrierwave.rb"
22
24
  end
23
25
 
26
+ def include_riak_test_server
27
+ if options.test_server?
28
+ File.open('spec/spec_helper.rb', 'w+') do |f| f.write(rspec_config)
29
+ end
30
+ template "_riak_test_server.yml", "/spec/support/riak_test_server.yml"
31
+ end
32
+ end
33
+
24
34
  private
25
35
 
26
36
  def gsub_file(relative_destination, regexp, *args, &block)
@@ -48,5 +58,36 @@ class ModulateGenerator < Rails::Generators::Base
48
58
  "app/views/#{tail}"
49
59
  end
50
60
 
51
- end
61
+ def rspec_config
62
+ %Q[CarrierWave.configure do |config|
63
+ config.storage = :riak
64
+ config.riak_nodes = [
65
+ { :host => "127.0.0.1", :http_port => 9000 }
66
+ ]
67
+ end
52
68
 
69
+ RSpec.configure do |config|
70
+
71
+ config.order = :random
72
+
73
+ config.before :suite do
74
+ begin
75
+ config = YAML.load_file('spec/support/test_server.yml')
76
+ $riak_test_server = Riak::TestServer.create(config.symbolize_keys)
77
+ $riak_test_server.start
78
+ rescue => e
79
+ warn "Can't run Riak::TestServer specs. Specify the location of your Riak installation in 'spec/support/test_server.yml. See warning e.inspect"
80
+ end
81
+ end
82
+
83
+ config.after :suite do
84
+ FileUtils.rm_rf(File.expand_path('../../uploads', __FILE__))
85
+ $riak_test_server.stop
86
+ puts "Stoping test server..."
87
+ $riak_test_Server = nil
88
+ FileUtils.rm_rf(File.expand_path('../test_server', __FILE__))
89
+ end
90
+ end]
91
+ end
92
+
93
+ end
@@ -0,0 +1,8 @@
1
+ source: /usr/local/Cellar/riak/1.2.0-x86_64/libexec/bin
2
+ root: spec/test_server/
3
+ :env:
4
+ :riak_core:
5
+ :http:
6
+ -
7
+ - "127.0.0.1"
8
+ - 9000
@@ -1,3 +1,3 @@
1
1
  module Modulate
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  class Account < ActiveRecord::Base
2
2
  modulate
3
3
 
4
- attr_accessible :modulate_documents_attributes
4
+ attr_accessible :modulate_documents_attributes, :modulate_uploads_attributes
5
5
 
6
6
  end
@@ -2,9 +2,9 @@
2
2
  = render "modulate_account_documents", f: f
3
3
 
4
4
  = f.inputs do
5
- = f.semantic_fields_for :modulate_documents, @account.modulate_documents.build do |d|
5
+ = f.semantic_fields_for :modulate_uploads, @account.modulate_documents.build do |d|
6
6
  = d.input(:attachment, as: :file, label: 'Choose document to attach', required: true,
7
- input_html: {multiple: true, name: "account[modulate_documents_attributes][][attachment]"}).sub('[attachment][]', '[attachment]').html_safe
7
+ input_html: {multiple: true, name: "account[modulate_uploads_attributes][][attachment]"}).sub('[attachment][]', '[attachment]').html_safe
8
8
 
9
9
  = f.actions do
10
10
  = f.action :submit, as: 'button', button_html: {class: 'btn btn-primary'}
@@ -3940,3 +3940,19 @@ Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2013-04-01 08:51:41
3940
3940
  Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-04-01 08:51:41 -0400
3941
3941
  Served asset /jquery_ujs.js - 200 OK (7ms)
3942
3942
  Served asset /application.js - 200 OK (9ms)
3943
+ Connecting to database specified by database.yml
3944
+ Connecting to database specified by database.yml
3945
+ Connecting to database specified by database.yml
3946
+ Connecting to database specified by database.yml
3947
+ Connecting to database specified by database.yml
3948
+ Connecting to database specified by database.yml
3949
+ Connecting to database specified by database.yml
3950
+ Connecting to database specified by database.yml
3951
+ Connecting to database specified by database.yml
3952
+ Connecting to database specified by database.yml
3953
+ Connecting to database specified by database.yml
3954
+ Connecting to database specified by database.yml
3955
+ Connecting to database specified by database.yml
3956
+ Connecting to database specified by database.yml
3957
+ Connecting to database specified by database.yml
3958
+ Connecting to database specified by database.yml
@@ -755,3 +755,441 @@ Processing by AccountsController#index as HTML
755
755
  Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` 
756
756
  Rendered accounts/index.html.haml within layouts/application (1.2ms)
757
757
  Completed 200 OK in 12ms (Views: 4.6ms | ActiveRecord: 0.3ms)
758
+ Connecting to database specified by database.yml
759
+  (0.1ms) BEGIN
760
+ SQL (3.1ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 13:37:29', 'test_account', '2013-04-05 13:37:29')
761
+  (0.6ms) COMMIT
762
+ Started GET "/accounts/53" for 127.0.0.1 at 2013-04-05 09:37:29 -0400
763
+ Processing by AccountsController#show as HTML
764
+ Parameters: {"id"=>"53"}
765
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 53 LIMIT 1
766
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 53 AND `modulate_documents`.`attachable_type` = 'Account'
767
+ Rendered accounts/_modulate_account_documents.html.haml (78.2ms)
768
+ Rendered accounts/_modulate_attachments.html.haml (407.3ms)
769
+ Rendered accounts/show.html.erb within layouts/application (426.2ms)
770
+ Completed 200 OK in 552ms (Views: 529.1ms | ActiveRecord: 3.0ms)
771
+ Started PUT "/accounts/53" for 127.0.0.1 at 2013-04-05 09:37:30 -0400
772
+ Processing by AccountsController#update as HTML
773
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_documents_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007f9b5bae6160 @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/RackMultipart20130405-87271-we0izg>>}]}, "button"=>"", "id"=>"53"}
774
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 53 LIMIT 1
775
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 53 AND `modulate_documents`.`attachable_type` = 'Account'
776
+  (0.1ms) BEGIN
777
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 53 LIMIT 1
778
+ Modulate::Document Exists (0.5ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '53-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
779
+ 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 (53, 'Account', 1, '53-test.txt', 'Dummy::Account', 'text/plain', '2013-04-05 13:37:30', 'test.txt', '53-test.txt', NULL, 0, '2013-04-05 13:37:30')
780
+  (0.5ms) ROLLBACK
781
+ Completed 500 Internal Server Error in 141ms
782
+ Connecting to database specified by database.yml
783
+  (0.1ms) BEGIN
784
+ SQL (2.1ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 14:00:28', 'test_account', '2013-04-05 14:00:28')
785
+  (0.4ms) COMMIT
786
+ Started GET "/accounts/54" for 127.0.0.1 at 2013-04-05 10:00:28 -0400
787
+ Processing by AccountsController#show as HTML
788
+ Parameters: {"id"=>"54"}
789
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 54 LIMIT 1
790
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 54 AND `modulate_documents`.`attachable_type` = 'Account'
791
+ Rendered accounts/_modulate_account_documents.html.haml (56.8ms)
792
+ Rendered accounts/_modulate_attachments.html.haml (270.8ms)
793
+ Rendered accounts/show.html.erb within layouts/application (280.3ms)
794
+ Completed 200 OK in 356ms (Views: 346.8ms | ActiveRecord: 3.0ms)
795
+ Started PUT "/accounts/54" for 127.0.0.1 at 2013-04-05 10:00:28 -0400
796
+ Processing by AccountsController#update as HTML
797
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_documents_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007fec51d13a68 @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/RackMultipart20130405-89304-1vm7p5v>>}]}, "button"=>"", "id"=>"54"}
798
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 54 LIMIT 1
799
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 54 AND `modulate_documents`.`attachable_type` = 'Account'
800
+  (0.1ms) BEGIN
801
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 54 LIMIT 1
802
+ Modulate::Document Exists (0.5ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '54-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
803
+ 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 (54, 'Account', 1, '54-test.txt', 'Dummy::Account', 'text/plain', '2013-04-05 14:00:28', 'test.txt', '54-test.txt', NULL, 0, '2013-04-05 14:00:28')
804
+  (0.5ms) ROLLBACK
805
+ Completed 500 Internal Server Error in 131ms
806
+ Connecting to database specified by database.yml
807
+  (0.1ms) BEGIN
808
+ SQL (2.1ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 14:04:23', 'test_account', '2013-04-05 14:04:23')
809
+  (0.4ms) COMMIT
810
+ Started GET "/accounts/55" for 127.0.0.1 at 2013-04-05 10:04:23 -0400
811
+ Processing by AccountsController#show as HTML
812
+ Parameters: {"id"=>"55"}
813
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 55 LIMIT 1
814
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 55 AND `modulate_documents`.`attachable_type` = 'Account'
815
+ Rendered accounts/_modulate_account_documents.html.haml (52.2ms)
816
+ Rendered accounts/_modulate_attachments.html.haml (267.7ms)
817
+ Rendered accounts/show.html.erb within layouts/application (277.0ms)
818
+ Completed 200 OK in 354ms (Views: 344.9ms | ActiveRecord: 3.0ms)
819
+ Started PUT "/accounts/55" for 127.0.0.1 at 2013-04-05 10:04:24 -0400
820
+ Processing by AccountsController#update as HTML
821
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_documents_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007fa982b0b840 @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/RackMultipart20130405-89439-1y3b1qj>>}]}, "button"=>"", "id"=>"55"}
822
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 55 LIMIT 1
823
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 55 AND `modulate_documents`.`attachable_type` = 'Account'
824
+  (0.1ms) BEGIN
825
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 55 LIMIT 1
826
+ Modulate::Document Exists (0.3ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '55-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
827
+ 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 (55, 'Account', 1, '55-test.txt', 'Dummy::Account', 'text/plain', '2013-04-05 14:04:24', 'test.txt', '55-test.txt', NULL, 0, '2013-04-05 14:04:24')
828
+  (0.5ms) ROLLBACK
829
+ Completed 500 Internal Server Error in 105ms
830
+ Connecting to database specified by database.yml
831
+  (0.3ms) BEGIN
832
+ SQL (2.3ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 14:05:23', 'test_account', '2013-04-05 14:05:23')
833
+  (0.4ms) COMMIT
834
+ Started GET "/accounts/56" for 127.0.0.1 at 2013-04-05 10:05:24 -0400
835
+ Processing by AccountsController#show as HTML
836
+ Parameters: {"id"=>"56"}
837
+ Account Load (0.6ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 56 LIMIT 1
838
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 56 AND `modulate_documents`.`attachable_type` = 'Account'
839
+ Rendered accounts/_modulate_account_documents.html.haml (100.5ms)
840
+ Rendered accounts/_modulate_attachments.html.haml (270.4ms)
841
+ Rendered accounts/show.html.erb within layouts/application (280.7ms)
842
+ Completed 200 OK in 307ms (Views: 297.0ms | ActiveRecord: 3.2ms)
843
+ Started PUT "/accounts/56" for 127.0.0.1 at 2013-04-05 10:05:24 -0400
844
+ Processing by AccountsController#update as HTML
845
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_documents_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007fc11da801e8 @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/RackMultipart20130405-89473-a4ejt0>>}]}, "button"=>"", "id"=>"56"}
846
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 56 LIMIT 1
847
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 56 AND `modulate_documents`.`attachable_type` = 'Account'
848
+  (0.1ms) BEGIN
849
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 56 LIMIT 1
850
+ Modulate::Document Exists (0.4ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '56-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
851
+ 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 (56, 'Account', 1, '56-test.txt', 'Dummy::Account', 'text/plain', '2013-04-05 14:05:24', 'test.txt', '56-test.txt', NULL, 0, '2013-04-05 14:05:24')
852
+  (0.4ms) COMMIT
853
+ Redirected to http://www.example.com/accounts
854
+ Completed 302 Found in 229ms (ActiveRecord: 1.8ms)
855
+ Started GET "/accounts" for 127.0.0.1 at 2013-04-05 10:05:24 -0400
856
+ Processing by AccountsController#index as HTML
857
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` 
858
+ Rendered accounts/index.html.haml within layouts/application (1.2ms)
859
+ Completed 200 OK in 13ms (Views: 4.8ms | ActiveRecord: 0.3ms)
860
+ Connecting to database specified by database.yml
861
+  (0.1ms) BEGIN
862
+ SQL (2.5ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 14:06:24', 'test_account', '2013-04-05 14:06:24')
863
+  (0.4ms) COMMIT
864
+ Started GET "/accounts/57" for 127.0.0.1 at 2013-04-05 10:06:24 -0400
865
+ Processing by AccountsController#show as HTML
866
+ Parameters: {"id"=>"57"}
867
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 57 LIMIT 1
868
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 57 AND `modulate_documents`.`attachable_type` = 'Account'
869
+ Rendered accounts/_modulate_account_documents.html.haml (54.2ms)
870
+ Rendered accounts/_modulate_attachments.html.haml (268.0ms)
871
+ Rendered accounts/show.html.erb within layouts/application (277.7ms)
872
+ Completed 200 OK in 356ms (Views: 345.8ms | ActiveRecord: 3.0ms)
873
+ Started PUT "/accounts/57" for 127.0.0.1 at 2013-04-05 10:06:25 -0400
874
+ Processing by AccountsController#update as HTML
875
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_documents_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007fbc732da780 @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/RackMultipart20130405-89682-163sauc>>}]}, "button"=>"", "id"=>"57"}
876
+ Account Load (0.4ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 57 LIMIT 1
877
+ Modulate::Document Load (0.5ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 57 AND `modulate_documents`.`attachable_type` = 'Account'
878
+  (0.1ms) BEGIN
879
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 57 LIMIT 1
880
+ Modulate::Document Exists (0.4ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '57-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
881
+ 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 (57, 'Account', 1, '57-test.txt', 'Dummy::Account', 'text/plain', '2013-04-05 14:06:25', 'test.txt', '57-test.txt', NULL, 0, '2013-04-05 14:06:25')
882
+  (0.5ms) COMMIT
883
+ Redirected to http://www.example.com/accounts
884
+ Completed 302 Found in 112ms (ActiveRecord: 2.1ms)
885
+ Started GET "/accounts" for 127.0.0.1 at 2013-04-05 10:06:25 -0400
886
+ Processing by AccountsController#index as HTML
887
+ Account Load (0.4ms) SELECT `accounts`.* FROM `accounts` 
888
+ Rendered accounts/index.html.haml within layouts/application (1.2ms)
889
+ Completed 200 OK in 13ms (Views: 4.6ms | ActiveRecord: 0.4ms)
890
+ Connecting to database specified by database.yml
891
+  (0.1ms) BEGIN
892
+ SQL (2.4ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 14:16:12', 'test_account', '2013-04-05 14:16:12')
893
+  (0.4ms) COMMIT
894
+ Started GET "/accounts/58" for 127.0.0.1 at 2013-04-05 10:16:12 -0400
895
+ Processing by AccountsController#show as HTML
896
+ Parameters: {"id"=>"58"}
897
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 58 LIMIT 1
898
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 58 AND `modulate_documents`.`attachable_type` = 'Account'
899
+ Rendered accounts/_modulate_account_documents.html.haml (55.1ms)
900
+ Rendered accounts/_modulate_attachments.html.haml (225.0ms)
901
+ Rendered accounts/show.html.erb within layouts/application (279.2ms)
902
+ Completed 200 OK in 307ms (Views: 296.5ms | ActiveRecord: 3.1ms)
903
+ Started PUT "/accounts/58" for 127.0.0.1 at 2013-04-05 10:16:13 -0400
904
+ Processing by AccountsController#update as HTML
905
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_documents_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007fa86bf546f8 @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/RackMultipart20130405-90063-upth51>>}]}, "button"=>"", "id"=>"58"}
906
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 58 LIMIT 1
907
+ Modulate::Document Load (0.4ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 58 AND `modulate_documents`.`attachable_type` = 'Account'
908
+  (0.1ms) BEGIN
909
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 58 LIMIT 1
910
+ Modulate::Document Exists (0.3ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '58-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
911
+ 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 (58, 'Account', 1, '58-test.txt', 'Dummy::Account', 'text/plain', '2013-04-05 14:16:13', 'test.txt', '58-test.txt', NULL, 0, '2013-04-05 14:16:13')
912
+  (17.7ms) COMMIT
913
+ Redirected to http://www.example.com/accounts
914
+ Completed 302 Found in 81ms (ActiveRecord: 19.1ms)
915
+ Started GET "/accounts" for 127.0.0.1 at 2013-04-05 10:16:13 -0400
916
+ Processing by AccountsController#index as HTML
917
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` 
918
+ Rendered accounts/index.html.haml within layouts/application (1.2ms)
919
+ Completed 200 OK in 14ms (Views: 5.0ms | ActiveRecord: 0.3ms)
920
+ Connecting to database specified by database.yml
921
+  (0.1ms) BEGIN
922
+ SQL (2.3ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 14:18:24', 'test_account', '2013-04-05 14:18:24')
923
+  (0.4ms) COMMIT
924
+ Started GET "/accounts/59" for 127.0.0.1 at 2013-04-05 10:18:24 -0400
925
+ Processing by AccountsController#show as HTML
926
+ Parameters: {"id"=>"59"}
927
+ Account Load (0.5ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 59 LIMIT 1
928
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 59 AND `modulate_documents`.`attachable_type` = 'Account'
929
+ Rendered accounts/_modulate_account_documents.html.haml (100.9ms)
930
+ Rendered accounts/_modulate_attachments.html.haml (273.2ms)
931
+ Rendered accounts/show.html.erb within layouts/application (287.2ms)
932
+ Completed 200 OK in 322ms (Views: 310.7ms | ActiveRecord: 3.5ms)
933
+ Started PUT "/accounts/59" for 127.0.0.1 at 2013-04-05 10:18:25 -0400
934
+ Processing by AccountsController#update as HTML
935
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_documents_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007fec23ed13b0 @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/RackMultipart20130405-90146-12ysb2f>>}]}, "button"=>"", "id"=>"59"}
936
+ Account Load (0.4ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 59 LIMIT 1
937
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 59 AND `modulate_documents`.`attachable_type` = 'Account'
938
+  (0.1ms) BEGIN
939
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 59 LIMIT 1
940
+ Modulate::Document Exists (0.3ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '59-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
941
+ 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 (59, 'Account', 1, '59-test.txt', 'Dummy::Account', 'text/plain', '2013-04-05 14:18:25', 'test.txt', '59-test.txt', NULL, 0, '2013-04-05 14:18:25')
942
+  (0.4ms) COMMIT
943
+ Redirected to http://www.example.com/accounts
944
+ Completed 302 Found in 111ms (ActiveRecord: 1.8ms)
945
+ Started GET "/accounts" for 127.0.0.1 at 2013-04-05 10:18:25 -0400
946
+ Processing by AccountsController#index as HTML
947
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` 
948
+ Rendered accounts/index.html.haml within layouts/application (1.2ms)
949
+ Completed 200 OK in 13ms (Views: 4.6ms | ActiveRecord: 0.3ms)
950
+ Connecting to database specified by database.yml
951
+  (0.1ms) BEGIN
952
+ SQL (2.2ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 14:18:52', 'test_account', '2013-04-05 14:18:52')
953
+  (0.4ms) COMMIT
954
+ Started GET "/accounts/60" for 127.0.0.1 at 2013-04-05 10:18:52 -0400
955
+ Processing by AccountsController#show as HTML
956
+ Parameters: {"id"=>"60"}
957
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 60 LIMIT 1
958
+  (0.4ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 60 AND `modulate_documents`.`attachable_type` = 'Account'
959
+ Rendered accounts/_modulate_account_documents.html.haml (80.4ms)
960
+ Rendered accounts/_modulate_attachments.html.haml (254.6ms)
961
+ Rendered accounts/show.html.erb within layouts/application (365.5ms)
962
+ Completed 200 OK in 561ms (Views: 518.3ms | ActiveRecord: 3.3ms)
963
+ Started PUT "/accounts/60" for 127.0.0.1 at 2013-04-05 10:18:53 -0400
964
+ Processing by AccountsController#update as HTML
965
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_documents_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007fa9553dae68 @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/RackMultipart20130405-90207-cfxpjd>>}]}, "button"=>"", "id"=>"60"}
966
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 60 LIMIT 1
967
+ Modulate::Document Load (0.4ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 60 AND `modulate_documents`.`attachable_type` = 'Account'
968
+  (0.1ms) BEGIN
969
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 60 LIMIT 1
970
+ Modulate::Document Exists (0.3ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '60-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
971
+ 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 (60, 'Account', 1, '60-test.txt', 'Dummy::Account', 'text/plain', '2013-04-05 14:18:53', 'test.txt', '60-test.txt', NULL, 0, '2013-04-05 14:18:53')
972
+  (0.4ms) COMMIT
973
+ Redirected to http://www.example.com/accounts
974
+ Completed 302 Found in 69ms (ActiveRecord: 1.8ms)
975
+ Started GET "/accounts" for 127.0.0.1 at 2013-04-05 10:18:53 -0400
976
+ Processing by AccountsController#index as HTML
977
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` 
978
+ Rendered accounts/index.html.haml within layouts/application (1.3ms)
979
+ Completed 200 OK in 13ms (Views: 4.7ms | ActiveRecord: 0.3ms)
980
+ Connecting to database specified by database.yml
981
+  (0.1ms) BEGIN
982
+ SQL (2.4ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 14:49:27', 'test_account', '2013-04-05 14:49:27')
983
+  (0.4ms) COMMIT
984
+ Started GET "/accounts/61" for 127.0.0.1 at 2013-04-05 10:49:27 -0400
985
+ Processing by AccountsController#show as HTML
986
+ Parameters: {"id"=>"61"}
987
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 61 LIMIT 1
988
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 61 AND `modulate_documents`.`attachable_type` = 'Account'
989
+ Rendered accounts/_modulate_account_documents.html.haml (121.9ms)
990
+ Modulate::Document Load (0.4ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 61 AND `modulate_documents`.`attachable_type` = 'Account'
991
+ Rendered accounts/_modulate_attachments.html.haml (290.5ms)
992
+ Rendered accounts/show.html.erb within layouts/application (300.2ms)
993
+ Completed 200 OK in 326ms (Views: 316.1ms | ActiveRecord: 3.3ms)
994
+ Connecting to database specified by database.yml
995
+  (0.4ms) BEGIN
996
+ SQL (3.9ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 14:50:48', 'test_account', '2013-04-05 14:50:48')
997
+  (0.4ms) COMMIT
998
+ Started GET "/accounts/62" for 127.0.0.1 at 2013-04-05 10:50:48 -0400
999
+ Processing by AccountsController#show as HTML
1000
+ Parameters: {"id"=>"62"}
1001
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 62 LIMIT 1
1002
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 62 AND `modulate_documents`.`attachable_type` = 'Account'
1003
+ Rendered accounts/_modulate_account_documents.html.haml (52.0ms)
1004
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 62 AND `modulate_documents`.`attachable_type` = 'Account'
1005
+ Rendered accounts/_modulate_attachments.html.haml (281.2ms)
1006
+ Rendered accounts/show.html.erb within layouts/application (290.5ms)
1007
+ Completed 200 OK in 364ms (Views: 354.8ms | ActiveRecord: 3.3ms)
1008
+ Connecting to database specified by database.yml
1009
+  (0.4ms) BEGIN
1010
+ SQL (2.1ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 14:52:45', 'test_account', '2013-04-05 14:52:45')
1011
+  (0.4ms) COMMIT
1012
+ Started GET "/accounts/63" for 127.0.0.1 at 2013-04-05 10:52:45 -0400
1013
+ Processing by AccountsController#show as HTML
1014
+ Parameters: {"id"=>"63"}
1015
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 63 LIMIT 1
1016
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 63 AND `modulate_documents`.`attachable_type` = 'Account'
1017
+ Rendered accounts/_modulate_account_documents.html.haml (54.3ms)
1018
+ Modulate::Document Load (0.4ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 63 AND `modulate_documents`.`attachable_type` = 'Account'
1019
+ Rendered accounts/_modulate_attachments.html.haml (291.4ms)
1020
+ Rendered accounts/show.html.erb within layouts/application (301.0ms)
1021
+ Completed 200 OK in 379ms (Views: 369.5ms | ActiveRecord: 3.3ms)
1022
+ Started PUT "/accounts/63" for 127.0.0.1 at 2013-04-05 10:52:46 -0400
1023
+ Processing by AccountsController#update as HTML
1024
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_uploads_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007ff4ee59dce8 @original_filename="test.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"account[modulate_uploads_attributes][][attachment]\"; filename=\"test.txt\"\r\nContent-Type: text/plain\r\nContent-Length: 25\r\n", @tempfile=#<File:/var/folders/lb/j1c12jc524zfb75l84v94qr40000gn/T/RackMultipart20130405-91859-1n51d0w>>}]}, "button"=>"", "id"=>"63"}
1025
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 63 LIMIT 1
1026
+ Completed 500 Internal Server Error in 3ms
1027
+ Connecting to database specified by database.yml
1028
+  (0.2ms) BEGIN
1029
+ SQL (2.1ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 14:52:56', 'test_account', '2013-04-05 14:52:56')
1030
+  (0.5ms) COMMIT
1031
+ Started GET "/accounts/64" for 127.0.0.1 at 2013-04-05 10:52:57 -0400
1032
+ Processing by AccountsController#show as HTML
1033
+ Parameters: {"id"=>"64"}
1034
+ Account Load (0.4ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 64 LIMIT 1
1035
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 64 AND `modulate_documents`.`attachable_type` = 'Account'
1036
+ Rendered accounts/_modulate_account_documents.html.haml (55.7ms)
1037
+ Modulate::Document Load (0.4ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 64 AND `modulate_documents`.`attachable_type` = 'Account'
1038
+ Rendered accounts/_modulate_attachments.html.haml (286.0ms)
1039
+ Rendered accounts/show.html.erb within layouts/application (294.9ms)
1040
+ Completed 200 OK in 371ms (Views: 361.2ms | ActiveRecord: 3.4ms)
1041
+ Started PUT "/accounts/64" for 127.0.0.1 at 2013-04-05 10:53:06 -0400
1042
+ Processing by AccountsController#update as HTML
1043
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_uploads_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007fd05c22f1f8 @original_filename="test.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"account[modulate_uploads_attributes][][attachment]\"; filename=\"test.txt\"\r\nContent-Type: text/plain\r\nContent-Length: 25\r\n", @tempfile=#<File:/var/folders/lb/j1c12jc524zfb75l84v94qr40000gn/T/RackMultipart20130405-91885-a1lir5>>}]}, "button"=>"", "id"=>"64"}
1044
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 64 LIMIT 1
1045
+ Completed 500 Internal Server Error in 3ms
1046
+ Connecting to database specified by database.yml
1047
+  (0.5ms) BEGIN
1048
+ SQL (2.1ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 14:53:13', 'test_account', '2013-04-05 14:53:13')
1049
+  (0.4ms) COMMIT
1050
+ Started GET "/accounts/65" for 127.0.0.1 at 2013-04-05 10:53:13 -0400
1051
+ Processing by AccountsController#show as HTML
1052
+ Parameters: {"id"=>"65"}
1053
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 65 LIMIT 1
1054
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 65 AND `modulate_documents`.`attachable_type` = 'Account'
1055
+ Rendered accounts/_modulate_account_documents.html.haml (52.9ms)
1056
+ Modulate::Document Load (0.4ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 65 AND `modulate_documents`.`attachable_type` = 'Account'
1057
+ Rendered accounts/_modulate_attachments.html.haml (285.2ms)
1058
+ Rendered accounts/show.html.erb within layouts/application (294.0ms)
1059
+ Completed 200 OK in 369ms (Views: 359.4ms | ActiveRecord: 3.4ms)
1060
+ Started PUT "/accounts/65" for 127.0.0.1 at 2013-04-05 10:54:29 -0400
1061
+ Processing by AccountsController#update as HTML
1062
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_uploads_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007f9d4b99c088 @original_filename="test.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"account[modulate_uploads_attributes][][attachment]\"; filename=\"test.txt\"\r\nContent-Type: text/plain\r\nContent-Length: 25\r\n", @tempfile=#<File:/var/folders/lb/j1c12jc524zfb75l84v94qr40000gn/T/RackMultipart20130405-91914-66n5b8>>}]}, "button"=>"", "id"=>"65"}
1063
+ Account Load (0.4ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 65 LIMIT 1
1064
+ Completed 500 Internal Server Error in 3ms
1065
+ Connecting to database specified by database.yml
1066
+  (0.1ms) BEGIN
1067
+ SQL (2.1ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 14:56:48', 'test_account', '2013-04-05 14:56:48')
1068
+  (0.4ms) COMMIT
1069
+ Started GET "/accounts/66" for 127.0.0.1 at 2013-04-05 10:56:49 -0400
1070
+ Processing by AccountsController#show as HTML
1071
+ Parameters: {"id"=>"66"}
1072
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 66 LIMIT 1
1073
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 66 AND `modulate_documents`.`attachable_type` = 'Account'
1074
+ Rendered accounts/_modulate_account_documents.html.haml (97.9ms)
1075
+ Modulate::Document Load (0.4ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 66 AND `modulate_documents`.`attachable_type` = 'Account'
1076
+ Rendered accounts/_modulate_attachments.html.haml (280.0ms)
1077
+ Rendered accounts/show.html.erb within layouts/application (291.2ms)
1078
+ Completed 200 OK in 316ms (Views: 307.0ms | ActiveRecord: 3.3ms)
1079
+ Started PUT "/accounts/66" for 127.0.0.1 at 2013-04-05 10:56:54 -0400
1080
+ Processing by AccountsController#update as HTML
1081
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_uploads_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007fc9cc568a18 @original_filename="test.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"account[modulate_uploads_attributes][][attachment]\"; filename=\"test.txt\"\r\nContent-Type: text/plain\r\nContent-Length: 25\r\n", @tempfile=#<File:/var/folders/lb/j1c12jc524zfb75l84v94qr40000gn/T/RackMultipart20130405-92011-fyogtd>>}]}, "button"=>"", "id"=>"66"}
1082
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 66 LIMIT 1
1083
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 66 AND `modulate_documents`.`attachable_type` = 'Account'
1084
+  (0.1ms) BEGIN
1085
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 66 LIMIT 1
1086
+ Modulate::Document Exists (0.3ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '66-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
1087
+ 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 (66, 'Account', NULL, '66-test.txt', 'Dummy::Account', 'text/plain', '2013-04-05 14:56:55', 'test.txt', '66-test.txt', NULL, 0, '2013-04-05 14:56:55')
1088
+  (0.5ms) ROLLBACK
1089
+ Completed 500 Internal Server Error in 109ms
1090
+ Connecting to database specified by database.yml
1091
+  (0.1ms) BEGIN
1092
+ SQL (2.1ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 14:57:12', 'test_account', '2013-04-05 14:57:12')
1093
+  (0.4ms) COMMIT
1094
+ Started GET "/accounts/67" for 127.0.0.1 at 2013-04-05 10:57:12 -0400
1095
+ Processing by AccountsController#show as HTML
1096
+ Parameters: {"id"=>"67"}
1097
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 67 LIMIT 1
1098
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 67 AND `modulate_documents`.`attachable_type` = 'Account'
1099
+ Rendered accounts/_modulate_account_documents.html.haml (52.0ms)
1100
+ Modulate::Document Load (0.4ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 67 AND `modulate_documents`.`attachable_type` = 'Account'
1101
+ Rendered accounts/_modulate_attachments.html.haml (233.9ms)
1102
+ Rendered accounts/show.html.erb within layouts/application (288.0ms)
1103
+ Completed 200 OK in 313ms (Views: 303.4ms | ActiveRecord: 3.4ms)
1104
+ Started PUT "/accounts/67" for 127.0.0.1 at 2013-04-05 11:01:01 -0400
1105
+ Processing by AccountsController#update as HTML
1106
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_uploads_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007f8c34a1f230 @original_filename="test.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"account[modulate_uploads_attributes][][attachment]\"; filename=\"test.txt\"\r\nContent-Type: text/plain\r\nContent-Length: 25\r\n", @tempfile=#<File:/var/folders/lb/j1c12jc524zfb75l84v94qr40000gn/T/RackMultipart20130405-92040-qeid65>>}]}, "button"=>"", "id"=>"67"}
1107
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 67 LIMIT 1
1108
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 67 AND `modulate_documents`.`attachable_type` = 'Account'
1109
+  (0.1ms) BEGIN
1110
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 67 LIMIT 1
1111
+ Modulate::Document Exists (0.3ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '67-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
1112
+ 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 (67, 'Account', NULL, '67-test.txt', 'Dummy::Account', 'text/plain', '2013-04-05 15:01:01', 'test.txt', '67-test.txt', NULL, 0, '2013-04-05 15:01:01')
1113
+  (0.5ms) ROLLBACK
1114
+ Completed 500 Internal Server Error in 105ms
1115
+ Connecting to database specified by database.yml
1116
+  (0.1ms) BEGIN
1117
+ SQL (2.1ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 15:01:08', 'test_account', '2013-04-05 15:01:08')
1118
+  (0.4ms) COMMIT
1119
+ Started GET "/accounts/68" for 127.0.0.1 at 2013-04-05 11:01:08 -0400
1120
+ Processing by AccountsController#show as HTML
1121
+ Parameters: {"id"=>"68"}
1122
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 68 LIMIT 1
1123
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 68 AND `modulate_documents`.`attachable_type` = 'Account'
1124
+ Rendered accounts/_modulate_account_documents.html.haml (98.0ms)
1125
+ Modulate::Document Load (0.4ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 68 AND `modulate_documents`.`attachable_type` = 'Account'
1126
+ Rendered accounts/_modulate_attachments.html.haml (282.5ms)
1127
+ Rendered accounts/show.html.erb within layouts/application (291.3ms)
1128
+ Completed 200 OK in 315ms (Views: 306.0ms | ActiveRecord: 3.4ms)
1129
+ Started PUT "/accounts/68" for 127.0.0.1 at 2013-04-05 11:03:52 -0400
1130
+ Processing by AccountsController#update as HTML
1131
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_uploads_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007fd285719648 @original_filename="test.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"account[modulate_uploads_attributes][][attachment]\"; filename=\"test.txt\"\r\nContent-Type: text/plain\r\nContent-Length: 25\r\n", @tempfile=#<File:/var/folders/lb/j1c12jc524zfb75l84v94qr40000gn/T/RackMultipart20130405-92315-9m66li>>}]}, "button"=>"", "id"=>"68"}
1132
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 68 LIMIT 1
1133
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 68 AND `modulate_documents`.`attachable_type` = 'Account'
1134
+  (0.1ms) BEGIN
1135
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 68 LIMIT 1
1136
+ Modulate::Document Exists (0.3ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '68-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
1137
+ 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 (68, 'Account', NULL, '68-test.txt', 'Dummy::Account', 'text/plain', '2013-04-05 15:03:52', 'test.txt', '68-test.txt', NULL, 0, '2013-04-05 15:03:52')
1138
+  (0.5ms) ROLLBACK
1139
+ Completed 500 Internal Server Error in 106ms
1140
+ Connecting to database specified by database.yml
1141
+  (0.1ms) BEGIN
1142
+ SQL (2.1ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 15:03:59', 'test_account', '2013-04-05 15:03:59')
1143
+  (0.4ms) COMMIT
1144
+ Started GET "/accounts/69" for 127.0.0.1 at 2013-04-05 11:03:59 -0400
1145
+ Processing by AccountsController#show as HTML
1146
+ Parameters: {"id"=>"69"}
1147
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 69 LIMIT 1
1148
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 69 AND `modulate_documents`.`attachable_type` = 'Account'
1149
+ Rendered accounts/_modulate_account_documents.html.haml (54.9ms)
1150
+ Modulate::Document Load (0.4ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 69 AND `modulate_documents`.`attachable_type` = 'Account'
1151
+ Rendered accounts/_modulate_attachments.html.haml (279.2ms)
1152
+ Rendered accounts/show.html.erb within layouts/application (288.0ms)
1153
+ Completed 200 OK in 361ms (Views: 352.0ms | ActiveRecord: 3.4ms)
1154
+ Started PUT "/accounts/69" for 127.0.0.1 at 2013-04-05 11:04:04 -0400
1155
+ Processing by AccountsController#update as HTML
1156
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_uploads_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007fee26d2a138 @original_filename="test.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"account[modulate_uploads_attributes][][attachment]\"; filename=\"test.txt\"\r\nContent-Type: text/plain\r\nContent-Length: 25\r\n", @tempfile=#<File:/var/folders/lb/j1c12jc524zfb75l84v94qr40000gn/T/RackMultipart20130405-92379-7y2e1t>>}]}, "button"=>"", "id"=>"69"}
1157
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 69 LIMIT 1
1158
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 69 AND `modulate_documents`.`attachable_type` = 'Account'
1159
+  (0.1ms) BEGIN
1160
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 69 LIMIT 1
1161
+ Modulate::Document Exists (0.3ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '69-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
1162
+ 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 (69, 'Account', NULL, '69-test.txt', 'Dummy::Account', 'text/plain', '2013-04-05 15:04:05', 'test.txt', '69-test.txt', NULL, 0, '2013-04-05 15:04:05')
1163
+  (0.5ms) ROLLBACK
1164
+ Completed 500 Internal Server Error in 59ms
1165
+ Connecting to database specified by database.yml
1166
+  (0.1ms) BEGIN
1167
+ SQL (2.2ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-04-05 15:04:39', 'test_account', '2013-04-05 15:04:39')
1168
+  (0.4ms) COMMIT
1169
+ Started GET "/accounts/70" for 127.0.0.1 at 2013-04-05 11:04:39 -0400
1170
+ Processing by AccountsController#show as HTML
1171
+ Parameters: {"id"=>"70"}
1172
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 70 LIMIT 1
1173
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 70 AND `modulate_documents`.`attachable_type` = 'Account'
1174
+ Rendered accounts/_modulate_account_documents.html.haml (101.2ms)
1175
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 70 AND `modulate_documents`.`attachable_type` = 'Account'
1176
+ Rendered accounts/_modulate_attachments.html.haml (287.2ms)
1177
+ Rendered accounts/show.html.erb within layouts/application (297.4ms)
1178
+ Completed 200 OK in 323ms (Views: 312.5ms | ActiveRecord: 3.5ms)
1179
+ Started PUT "/accounts/70" for 127.0.0.1 at 2013-04-05 11:04:46 -0400
1180
+ Processing by AccountsController#update as HTML
1181
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_uploads_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007fa34bfb1c10 @original_filename="test.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"account[modulate_uploads_attributes][][attachment]\"; filename=\"test.txt\"\r\nContent-Type: text/plain\r\nContent-Length: 25\r\n", @tempfile=#<File:/var/folders/lb/j1c12jc524zfb75l84v94qr40000gn/T/RackMultipart20130405-92418-zy355m>>}]}, "button"=>"", "id"=>"70"}
1182
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 70 LIMIT 1
1183
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 70 AND `modulate_documents`.`attachable_type` = 'Account'
1184
+  (0.1ms) BEGIN
1185
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 70 LIMIT 1
1186
+ Modulate::Document Exists (0.3ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '70-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
1187
+ 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 (70, 'Account', NULL, '70-test.txt', 'Dummy::Account', 'text/plain', '2013-04-05 15:04:46', 'test.txt', '70-test.txt', NULL, 0, '2013-04-05 15:04:46')
1188
+  (0.4ms) COMMIT
1189
+ Redirected to http://www.example.com/accounts
1190
+ Completed 302 Found in 353ms (ActiveRecord: 1.8ms)
1191
+ Started GET "/accounts" for 127.0.0.1 at 2013-04-05 11:04:46 -0400
1192
+ Processing by AccountsController#index as HTML
1193
+ Account Load (0.4ms) SELECT `accounts`.* FROM `accounts`
1194
+ Rendered accounts/index.html.haml within layouts/application (1.5ms)
1195
+ Completed 200 OK in 15ms (Views: 5.3ms | ActiveRecord: 0.4ms)
@@ -0,0 +1 @@
1
+ This is a test document.
@@ -0,0 +1 @@
1
+ This is a test document.
@@ -0,0 +1 @@
1
+ This is a test document.
@@ -0,0 +1 @@
1
+ This is a test document.
@@ -0,0 +1 @@
1
+ This is a test document.
@@ -0,0 +1 @@
1
+ This is a test document.
@@ -0,0 +1 @@
1
+ This is a test document.
@@ -0,0 +1,29 @@
1
+ CarrierWave.configure do |config|
2
+ config.storage = :riak
3
+ config.riak_nodes = [
4
+ { :host => "127.0.0.1", :http_port => 9000 }
5
+ ]
6
+ end
7
+
8
+ RSpec.configure do |config|
9
+
10
+ config.order = :random
11
+
12
+ config.before :suite do
13
+ begin
14
+ config = YAML.load_file('spec/support/test_server.yml')
15
+ $riak_test_server = Riak::TestServer.create(config.symbolize_keys)
16
+ $riak_test_server.start
17
+ rescue => e
18
+ warn "Can't run Riak::TestServer specs. Specify the location of your Riak installation in 'spec/support/test_server.yml. See warning e.inspect"
19
+ end
20
+ end
21
+
22
+ config.after :suite do
23
+ FileUtils.rm_rf(File.expand_path('../../uploads', __FILE__))
24
+ $riak_test_server.stop
25
+ puts "Stoping test server..."
26
+ $riak_test_Server = nil
27
+ FileUtils.rm_rf(File.expand_path('../test_server', __FILE__))
28
+ end
29
+ end
@@ -0,0 +1,8 @@
1
+ source: /usr/local/Cellar/riak/1.2.0-x86_64/libexec/bin
2
+ root: spec/test_server/
3
+ :env:
4
+ :riak_core:
5
+ :http:
6
+ -
7
+ - "127.0.0.1"
8
+ - 9000
@@ -0,0 +1,45 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
6
+ <script src="/assets/application.js" type="text/javascript"></script>
7
+
8
+ </head>
9
+ <body>
10
+
11
+
12
+
13
+ <form accept-charset="UTF-8" action="/accounts/65" class="formtastic account" enctype="multipart/form-data" id="edit_account_65" method="post" novalidate="novalidate"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="_method" type="hidden" value="put" /></div><table class='table table-bordered table-compressed'>
14
+ <thead>
15
+ <tr>
16
+ <th>Label</th>
17
+ <th>File Name</th>
18
+ <th>Content Type</th>
19
+ <th>Uploaded At</th>
20
+ <th>Public</th>
21
+ <th></th>
22
+ <th></th>
23
+ </tr>
24
+ </thead>
25
+ <tbody>
26
+ <tr>
27
+ <td colspan='7'>
28
+ <div class='no-results'>There are no documents.</div>
29
+ </td>
30
+ </tr>
31
+ </tbody>
32
+ </table>
33
+
34
+ <fieldset class="inputs"><ol><li class="file input required" id="account_modulate_uploads_attributes_0_attachment_input"><label class=" label" for="account_modulate_uploads_attributes_0_attachment">Choose document to attach<abbr title="required">*</abbr></label><input id="account_modulate_uploads_attributes_0_attachment" multiple="multiple" name="account[modulate_uploads_attributes][][attachment]" type="file" />
35
+
36
+ </li>
37
+ </ol></fieldset><fieldset class="actions"><ol><li class="action button_action " id="account_submit_action"><button class="btn btn-primary" name="button" type="submit">Update Account</button></li>
38
+ <li class="action link_action " id="account_cancel_action"><a href="javascript:history.back()">Cancel</a></li>
39
+ </ol></fieldset></form>
40
+
41
+
42
+
43
+
44
+ </body>
45
+ </html>
@@ -0,0 +1,45 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
6
+ <script src="/assets/application.js" type="text/javascript"></script>
7
+
8
+ </head>
9
+ <body>
10
+
11
+
12
+
13
+ <form accept-charset="UTF-8" action="/accounts/66" class="formtastic account" enctype="multipart/form-data" id="edit_account_66" method="post" novalidate="novalidate"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="_method" type="hidden" value="put" /></div><table class='table table-bordered table-compressed'>
14
+ <thead>
15
+ <tr>
16
+ <th>Label</th>
17
+ <th>File Name</th>
18
+ <th>Content Type</th>
19
+ <th>Uploaded At</th>
20
+ <th>Public</th>
21
+ <th></th>
22
+ <th></th>
23
+ </tr>
24
+ </thead>
25
+ <tbody>
26
+ <tr>
27
+ <td colspan='7'>
28
+ <div class='no-results'>There are no documents.</div>
29
+ </td>
30
+ </tr>
31
+ </tbody>
32
+ </table>
33
+
34
+ <fieldset class="inputs"><ol><li class="file input required" id="account_modulate_uploads_attributes_0_attachment_input"><label class=" label" for="account_modulate_uploads_attributes_0_attachment">Choose document to attach<abbr title="required">*</abbr></label><input id="account_modulate_uploads_attributes_0_attachment" multiple="multiple" name="account[modulate_uploads_attributes][][attachment]" type="file" />
35
+
36
+ </li>
37
+ </ol></fieldset><fieldset class="actions"><ol><li class="action button_action " id="account_submit_action"><button class="btn btn-primary" name="button" type="submit">Update Account</button></li>
38
+ <li class="action link_action " id="account_cancel_action"><a href="javascript:history.back()">Cancel</a></li>
39
+ </ol></fieldset></form>
40
+
41
+
42
+
43
+
44
+ </body>
45
+ </html>
@@ -0,0 +1,45 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
6
+ <script src="/assets/application.js" type="text/javascript"></script>
7
+
8
+ </head>
9
+ <body>
10
+
11
+
12
+
13
+ <form accept-charset="UTF-8" action="/accounts/67" class="formtastic account" enctype="multipart/form-data" id="edit_account_67" method="post" novalidate="novalidate"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="_method" type="hidden" value="put" /></div><table class='table table-bordered table-compressed'>
14
+ <thead>
15
+ <tr>
16
+ <th>Label</th>
17
+ <th>File Name</th>
18
+ <th>Content Type</th>
19
+ <th>Uploaded At</th>
20
+ <th>Public</th>
21
+ <th></th>
22
+ <th></th>
23
+ </tr>
24
+ </thead>
25
+ <tbody>
26
+ <tr>
27
+ <td colspan='7'>
28
+ <div class='no-results'>There are no documents.</div>
29
+ </td>
30
+ </tr>
31
+ </tbody>
32
+ </table>
33
+
34
+ <fieldset class="inputs"><ol><li class="file input required" id="account_modulate_uploads_attributes_0_attachment_input"><label class=" label" for="account_modulate_uploads_attributes_0_attachment">Choose document to attach<abbr title="required">*</abbr></label><input id="account_modulate_uploads_attributes_0_attachment" multiple="multiple" name="account[modulate_uploads_attributes][][attachment]" type="file" />
35
+
36
+ </li>
37
+ </ol></fieldset><fieldset class="actions"><ol><li class="action button_action " id="account_submit_action"><button class="btn btn-primary" name="button" type="submit">Update Account</button></li>
38
+ <li class="action link_action " id="account_cancel_action"><a href="javascript:history.back()">Cancel</a></li>
39
+ </ol></fieldset></form>
40
+
41
+
42
+
43
+
44
+ </body>
45
+ </html>
@@ -0,0 +1,45 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
6
+ <script src="/assets/application.js" type="text/javascript"></script>
7
+
8
+ </head>
9
+ <body>
10
+
11
+
12
+
13
+ <form accept-charset="UTF-8" action="/accounts/68" class="formtastic account" enctype="multipart/form-data" id="edit_account_68" method="post" novalidate="novalidate"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="_method" type="hidden" value="put" /></div><table class='table table-bordered table-compressed'>
14
+ <thead>
15
+ <tr>
16
+ <th>Label</th>
17
+ <th>File Name</th>
18
+ <th>Content Type</th>
19
+ <th>Uploaded At</th>
20
+ <th>Public</th>
21
+ <th></th>
22
+ <th></th>
23
+ </tr>
24
+ </thead>
25
+ <tbody>
26
+ <tr>
27
+ <td colspan='7'>
28
+ <div class='no-results'>There are no documents.</div>
29
+ </td>
30
+ </tr>
31
+ </tbody>
32
+ </table>
33
+
34
+ <fieldset class="inputs"><ol><li class="file input required" id="account_modulate_uploads_attributes_0_attachment_input"><label class=" label" for="account_modulate_uploads_attributes_0_attachment">Choose document to attach<abbr title="required">*</abbr></label><input id="account_modulate_uploads_attributes_0_attachment" multiple="multiple" name="account[modulate_uploads_attributes][][attachment]" type="file" />
35
+
36
+ </li>
37
+ </ol></fieldset><fieldset class="actions"><ol><li class="action button_action " id="account_submit_action"><button class="btn btn-primary" name="button" type="submit">Update Account</button></li>
38
+ <li class="action link_action " id="account_cancel_action"><a href="javascript:history.back()">Cancel</a></li>
39
+ </ol></fieldset></form>
40
+
41
+
42
+
43
+
44
+ </body>
45
+ </html>
@@ -0,0 +1,45 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
6
+ <script src="/assets/application.js" type="text/javascript"></script>
7
+
8
+ </head>
9
+ <body>
10
+
11
+
12
+
13
+ <form accept-charset="UTF-8" action="/accounts/69" class="formtastic account" enctype="multipart/form-data" id="edit_account_69" method="post" novalidate="novalidate"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="_method" type="hidden" value="put" /></div><table class='table table-bordered table-compressed'>
14
+ <thead>
15
+ <tr>
16
+ <th>Label</th>
17
+ <th>File Name</th>
18
+ <th>Content Type</th>
19
+ <th>Uploaded At</th>
20
+ <th>Public</th>
21
+ <th></th>
22
+ <th></th>
23
+ </tr>
24
+ </thead>
25
+ <tbody>
26
+ <tr>
27
+ <td colspan='7'>
28
+ <div class='no-results'>There are no documents.</div>
29
+ </td>
30
+ </tr>
31
+ </tbody>
32
+ </table>
33
+
34
+ <fieldset class="inputs"><ol><li class="file input required" id="account_modulate_uploads_attributes_0_attachment_input"><label class=" label" for="account_modulate_uploads_attributes_0_attachment">Choose document to attach<abbr title="required">*</abbr></label><input id="account_modulate_uploads_attributes_0_attachment" multiple="multiple" name="account[modulate_uploads_attributes][][attachment]" type="file" />
35
+
36
+ </li>
37
+ </ol></fieldset><fieldset class="actions"><ol><li class="action button_action " id="account_submit_action"><button class="btn btn-primary" name="button" type="submit">Update Account</button></li>
38
+ <li class="action link_action " id="account_cancel_action"><a href="javascript:history.back()">Cancel</a></li>
39
+ </ol></fieldset></form>
40
+
41
+
42
+
43
+
44
+ </body>
45
+ </html>
@@ -0,0 +1,45 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
6
+ <script src="/assets/application.js" type="text/javascript"></script>
7
+
8
+ </head>
9
+ <body>
10
+
11
+
12
+
13
+ <form accept-charset="UTF-8" action="/accounts/70" class="formtastic account" enctype="multipart/form-data" id="edit_account_70" method="post" novalidate="novalidate"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="_method" type="hidden" value="put" /></div><table class='table table-bordered table-compressed'>
14
+ <thead>
15
+ <tr>
16
+ <th>Label</th>
17
+ <th>File Name</th>
18
+ <th>Content Type</th>
19
+ <th>Uploaded At</th>
20
+ <th>Public</th>
21
+ <th></th>
22
+ <th></th>
23
+ </tr>
24
+ </thead>
25
+ <tbody>
26
+ <tr>
27
+ <td colspan='7'>
28
+ <div class='no-results'>There are no documents.</div>
29
+ </td>
30
+ </tr>
31
+ </tbody>
32
+ </table>
33
+
34
+ <fieldset class="inputs"><ol><li class="file input required" id="account_modulate_uploads_attributes_0_attachment_input"><label class=" label" for="account_modulate_uploads_attributes_0_attachment">Choose document to attach<abbr title="required">*</abbr></label><input id="account_modulate_uploads_attributes_0_attachment" multiple="multiple" name="account[modulate_uploads_attributes][][attachment]" type="file" />
35
+
36
+ </li>
37
+ </ol></fieldset><fieldset class="actions"><ol><li class="action button_action " id="account_submit_action"><button class="btn btn-primary" name="button" type="submit">Update Account</button></li>
38
+ <li class="action link_action " id="account_cancel_action"><a href="javascript:history.back()">Cancel</a></li>
39
+ </ol></fieldset></form>
40
+
41
+
42
+
43
+
44
+ </body>
45
+ </html>
@@ -6,7 +6,7 @@ describe "uploading a document" do
6
6
 
7
7
  it "stores the file to Riak" do
8
8
  visit "/accounts/#{account.id}"
9
- attach_file('account_modulate_documents_attributes_0_attachment', Rails.root.join('../../', 'spec', 'fixtures', 'test.txt'))
9
+ attach_file('account_modulate_uploads_attributes_0_attachment', Rails.root.join('../../', 'spec', 'fixtures', 'test.txt'))
10
10
  click_button "Update Account"
11
11
  expect(page).to have_content('successfully')
12
12
  end
data/spec/spec_helper.rb CHANGED
@@ -9,6 +9,8 @@ require "rspec/rails"
9
9
  require "factory_girl_rails"
10
10
  require "launchy"
11
11
  require "pry"
12
+ require 'riak/test_server'
13
+ require 'yaml'
12
14
 
13
15
  Rails.backtrace_cleaner.remove_silencers!
14
16
 
@@ -17,6 +19,33 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
17
19
 
18
20
  RSpec.configure do |config|
19
21
  config.mock_with :rspec
20
-
21
22
  config.order = :random
22
23
  end
24
+
25
+ CarrierWave.configure do |config|
26
+ config.storage = :riak
27
+ config.riak_nodes = [
28
+ { :host => "127.0.0.1", :http_port => 9000 }
29
+ ]
30
+ end
31
+
32
+ RSpec.configure do |config|
33
+
34
+ config.before :suite do
35
+ begin
36
+ config = YAML.load_file(File.expand_path('../support/test_server.yml', __FILE__))
37
+ $riak_test_server = Riak::TestServer.create(config.symbolize_keys)
38
+ $riak_test_server.start
39
+ rescue => e
40
+ warn "Can't run Riak::TestServer specs. Specify the location of your Riak installation in 'spec/support/test_server.yml. See warning e.inspect"
41
+ end
42
+ end
43
+
44
+ config.after :suite do
45
+ FileUtils.rm_rf(File.expand_path('../../uploads', __FILE__))
46
+ $riak_test_server.stop
47
+ puts "Stoping test server..."
48
+ $riak_test_Server = nil
49
+ FileUtils.rm_rf(File.expand_path('../test_server', __FILE__))
50
+ end
51
+ end
@@ -0,0 +1,9 @@
1
+ source: /usr/local/Cellar/riak/1.2.0-x86_64/libexec/bin
2
+ root: spec/test_server/
3
+ :env:
4
+ :riak_core:
5
+ :http:
6
+ -
7
+ - "127.0.0.1"
8
+ - 9000
9
+
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.8
4
+ version: 0.0.9
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-04-03 00:00:00.000000000 Z
12
+ date: 2013-04-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: carrierwave-riak
@@ -172,6 +172,7 @@ files:
172
172
  - lib/generators/modulate/templates/_carrierwave.rb
173
173
  - lib/generators/modulate/templates/_modulate_attachments.html.haml
174
174
  - lib/generators/modulate/templates/_modulate_documents.html.haml
175
+ - lib/generators/modulate/templates/_riak_test_server.yml
175
176
  - lib/generators/modulate/USAGE
176
177
  - lib/modulate/configuration.rb
177
178
  - lib/modulate/engine.rb
@@ -246,9 +247,18 @@ files:
246
247
  - spec/dummy/public/uploads/tmp/20130326-1409-11412-4323/test.txt
247
248
  - spec/dummy/public/uploads/tmp/20130326-1410-11453-4835/test.txt
248
249
  - spec/dummy/public/uploads/tmp/20130326-1411-11541-3107/test.txt
250
+ - spec/dummy/public/uploads/tmp/20130405-0937-87271-7051/test.txt
251
+ - spec/dummy/public/uploads/tmp/20130405-1000-89304-0382/test.txt
252
+ - spec/dummy/public/uploads/tmp/20130405-1004-89439-0962/test.txt
253
+ - spec/dummy/public/uploads/tmp/20130405-1056-92011-2291/test.txt
254
+ - spec/dummy/public/uploads/tmp/20130405-1101-92040-3866/test.txt
255
+ - spec/dummy/public/uploads/tmp/20130405-1103-92315-4868/test.txt
256
+ - spec/dummy/public/uploads/tmp/20130405-1104-92379-0419/test.txt
249
257
  - spec/dummy/Rakefile
250
258
  - spec/dummy/README.rdoc
251
259
  - spec/dummy/script/rails
260
+ - spec/dummy/spec/spec_helper.rb
261
+ - spec/dummy/spec/support/riak_test_server.yml
252
262
  - spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
253
263
  - spec/dummy/tmp/cache/assets/CE1/F20/sprockets%2F27802e706f9b4a4cb47f23279b8ef112
254
264
  - spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
@@ -267,6 +277,12 @@ files:
267
277
  - spec/dummy/tmp/capybara/capybara-201303251146231982487841.html
268
278
  - spec/dummy/tmp/capybara/capybara-201303251501229219755210.html
269
279
  - spec/dummy/tmp/capybara/capybara-201303251504055386888420.html
280
+ - spec/dummy/tmp/capybara/capybara-201304051053146722216650.html
281
+ - spec/dummy/tmp/capybara/capybara-201304051056491925571097.html
282
+ - spec/dummy/tmp/capybara/capybara-201304051057122353305121.html
283
+ - spec/dummy/tmp/capybara/capybara-2013040511010831294374.html
284
+ - spec/dummy/tmp/capybara/capybara-201304051104006370952070.html
285
+ - spec/dummy/tmp/capybara/capybara-201304051104405983646971.html
270
286
  - spec/dummy/tmp/restart.txt
271
287
  - spec/factories/account_factory.rb
272
288
  - spec/features/modulate_spec.rb
@@ -275,6 +291,7 @@ files:
275
291
  - spec/modulate/relation_spec.rb
276
292
  - spec/modulate_spec.rb
277
293
  - spec/spec_helper.rb
294
+ - spec/support/test_server.yml
278
295
  homepage: ''
279
296
  licenses: []
280
297
  post_install_message:
@@ -289,7 +306,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
289
306
  version: '0'
290
307
  segments:
291
308
  - 0
292
- hash: -4285118924785943183
309
+ hash: 2750575772189229921
293
310
  required_rubygems_version: !ruby/object:Gem::Requirement
294
311
  none: false
295
312
  requirements:
@@ -298,7 +315,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
298
315
  version: '0'
299
316
  segments:
300
317
  - 0
301
- hash: -4285118924785943183
318
+ hash: 2750575772189229921
302
319
  requirements: []
303
320
  rubyforge_project:
304
321
  rubygems_version: 1.8.24
@@ -373,9 +390,18 @@ test_files:
373
390
  - spec/dummy/public/uploads/tmp/20130326-1409-11412-4323/test.txt
374
391
  - spec/dummy/public/uploads/tmp/20130326-1410-11453-4835/test.txt
375
392
  - spec/dummy/public/uploads/tmp/20130326-1411-11541-3107/test.txt
393
+ - spec/dummy/public/uploads/tmp/20130405-0937-87271-7051/test.txt
394
+ - spec/dummy/public/uploads/tmp/20130405-1000-89304-0382/test.txt
395
+ - spec/dummy/public/uploads/tmp/20130405-1004-89439-0962/test.txt
396
+ - spec/dummy/public/uploads/tmp/20130405-1056-92011-2291/test.txt
397
+ - spec/dummy/public/uploads/tmp/20130405-1101-92040-3866/test.txt
398
+ - spec/dummy/public/uploads/tmp/20130405-1103-92315-4868/test.txt
399
+ - spec/dummy/public/uploads/tmp/20130405-1104-92379-0419/test.txt
376
400
  - spec/dummy/Rakefile
377
401
  - spec/dummy/README.rdoc
378
402
  - spec/dummy/script/rails
403
+ - spec/dummy/spec/spec_helper.rb
404
+ - spec/dummy/spec/support/riak_test_server.yml
379
405
  - spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
380
406
  - spec/dummy/tmp/cache/assets/CE1/F20/sprockets%2F27802e706f9b4a4cb47f23279b8ef112
381
407
  - spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
@@ -394,6 +420,12 @@ test_files:
394
420
  - spec/dummy/tmp/capybara/capybara-201303251146231982487841.html
395
421
  - spec/dummy/tmp/capybara/capybara-201303251501229219755210.html
396
422
  - spec/dummy/tmp/capybara/capybara-201303251504055386888420.html
423
+ - spec/dummy/tmp/capybara/capybara-201304051053146722216650.html
424
+ - spec/dummy/tmp/capybara/capybara-201304051056491925571097.html
425
+ - spec/dummy/tmp/capybara/capybara-201304051057122353305121.html
426
+ - spec/dummy/tmp/capybara/capybara-2013040511010831294374.html
427
+ - spec/dummy/tmp/capybara/capybara-201304051104006370952070.html
428
+ - spec/dummy/tmp/capybara/capybara-201304051104405983646971.html
397
429
  - spec/dummy/tmp/restart.txt
398
430
  - spec/factories/account_factory.rb
399
431
  - spec/features/modulate_spec.rb
@@ -402,3 +434,4 @@ test_files:
402
434
  - spec/modulate/relation_spec.rb
403
435
  - spec/modulate_spec.rb
404
436
  - spec/spec_helper.rb
437
+ - spec/support/test_server.yml