s3_relay 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9fe731c3a3cdd23942a9286530e37957dcb8b7e
4
- data.tar.gz: 634a0c6d096ab3ca4b903d05a86bbb4fdc4e76ec
3
+ metadata.gz: 6f7808fa908073f00317199da6e43b9821c7d827
4
+ data.tar.gz: 896e7707ba3031b0a5074bf1322d8c62ffc715f0
5
5
  SHA512:
6
- metadata.gz: e1a74b83d9b770d597775871e3cb3defb0f3471c33f90cef4185e18892460f5cfbf9d1c306ac24de35efa0aed6dcb0f59e4bc677a550a1c11db06ee1587df127
7
- data.tar.gz: 436ccc38e13a585e197f1b513b27b78378207b713be1b083b148d79d69e4263c54d1c2e226b25d34f20b18ca9194639d5adcf9d4113decba3e0a1678d42ebf0c
6
+ metadata.gz: 65db04a3d352ff2dee8d812450eb20f2065c8cc1c727dc8c278dc914c0a08879038241d96e6371414a0211d25c0f0e4177cf227e82492b666c604a9dc5f1b57a
7
+ data.tar.gz: 10239435d5ca2a5df99b4bf963ced838f2fd3561b03cfa2f5ec6941809575eab7cbcdfc93a257a9a0417d52c607738294a937ad3b9336ffdbfe10e46374a9aca
@@ -1,7 +1,7 @@
1
1
  class S3Relay::UploadsController < ApplicationController
2
2
 
3
- before_filter :authenticate
4
- skip_before_filter :verify_authenticity_token
3
+ before_action :authenticate
4
+ skip_before_action :verify_authenticity_token
5
5
 
6
6
  def new
7
7
  render json: S3Relay::UploadPresigner.new.form_data
@@ -1,3 +1,3 @@
1
1
  module S3Relay
2
- VERSION = "0.4.2"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -641,3 +641,348 @@ Processing by S3Relay::UploadsController#create as HTML
641
641
  Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.6ms)
642
642
   (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
643
643
   (0.1ms) ROLLBACK
644
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
645
+  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" DISABLE TRIGGER ALL
646
+  (0.9ms) select table_name from information_schema.views where table_schema = 's3_relay_test'
647
+  (9.5ms) TRUNCATE TABLE "ar_internal_metadata", "products", "s3_relay_uploads" RESTART IDENTITY CASCADE;
648
+  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL;ALTER TABLE "s3_relay_uploads" ENABLE TRIGGER ALL
649
+  (0.2ms) BEGIN
650
+ -------------------------------------------------------------------
651
+ S3Relay::UploadsController::POST create::error: test_0001_anonymous
652
+ -------------------------------------------------------------------
653
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
654
+ Processing by S3Relay::UploadsController#create as HTML
655
+ Parameters: {"uuid"=>"5fb67309-12b1-4abb-bd45-edcaa78eeba2", "filename"=>"cat.png", "content_type"=>"image/png"}
656
+  (0.1ms) SAVEPOINT active_record_1
657
+ S3Relay::Upload Exists (0.4ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
658
+ :value: 5fb67309-12b1-4abb-bd45-edcaa78eeba2
659
+ :format: 1
660
+ ' LIMIT 1
661
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
662
+ Completed 422 Unprocessable Entity in 26ms (Views: 0.2ms | ActiveRecord: 0.7ms)
663
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
664
+  (0.1ms) ROLLBACK
665
+  (0.1ms) BEGIN
666
+  (0.1ms) COMMIT
667
+  (0.0ms) BEGIN
668
+  (0.1ms) SAVEPOINT active_record_1
669
+ SQL (0.4ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 07:06:22.367700"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 07:06:22.367700"]]
670
+  (0.1ms) RELEASE SAVEPOINT active_record_1
671
+  (0.1ms) SAVEPOINT active_record_1
672
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
673
+ :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
674
+ :format: 1
675
+ ' LIMIT 1
676
+ SQL (0.3ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.375464"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2016-12-30 07:06:22.370188"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.375464"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
677
+  (0.1ms) RELEASE SAVEPOINT active_record_1
678
+  (0.1ms) SAVEPOINT active_record_1
679
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
680
+ :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
681
+ :format: 1
682
+ ' LIMIT 1
683
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.379096"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2016-12-30 07:06:22.377637"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.379096"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
684
+  (0.1ms) RELEASE SAVEPOINT active_record_1
685
+  (0.1ms) SAVEPOINT active_record_1
686
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
687
+ :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
688
+ :format: 1
689
+ ' LIMIT 1
690
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.382026"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 1], ["parent_type", "Product"], ["pending_at", "2016-12-30 07:06:22.380642"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.382026"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
691
+  (0.1ms) RELEASE SAVEPOINT active_record_1
692
+ S3Relay::Upload Load (0.6ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 1 AND "s3_relay_uploads"."upload_type" = 'IconUpload' ORDER BY pending_at ASC LIMIT 1
693
+  (0.1ms) ROLLBACK
694
+  (0.1ms) BEGIN
695
+ ------------------------------------------------------------------------------------------
696
+ S3Relay::UploadsHelper::#s3_relay_field::with disposition: attachment: test_0001_anonymous
697
+ ------------------------------------------------------------------------------------------
698
+  (0.1ms) SAVEPOINT active_record_1
699
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 07:06:22.389932"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 07:06:22.389932"]]
700
+  (0.1ms) RELEASE SAVEPOINT active_record_1
701
+  (0.1ms) ROLLBACK
702
+  (0.1ms) BEGIN
703
+ -----------------------------------------------------------------------
704
+ S3Relay::Upload::validations::upload_type: test_0001_validates presence
705
+ -----------------------------------------------------------------------
706
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
707
+  (0.1ms) ROLLBACK
708
+  (0.1ms) BEGIN
709
+ --------------------------------------------------------------------------------------------------------------------------------------------
710
+ S3Relay::UploadsController::POST create::success::with parent attributes::with a current_user: test_0001_associates the upload with the user
711
+ --------------------------------------------------------------------------------------------------------------------------------------------
712
+  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"
713
+ Processing by S3Relay::UploadsController#create as HTML
714
+ Parameters: {"association"=>"photo_uploads", "uuid"=>"eb4ec2ad-917c-46cd-a1f2-f7ebd02e3372", "filename"=>"cat.png", "content_type"=>"image/png"}
715
+  (0.1ms) SAVEPOINT active_record_1
716
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
717
+ :value: eb4ec2ad-917c-46cd-a1f2-f7ebd02e3372
718
+ :format: 1
719
+ ' LIMIT 1
720
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "user_id", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.403899"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 07:06:22.402479"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.403899"], ["upload_type", "PhotoUpload"], ["user_id", 123], ["uuid", "<36 bytes of binary data>"]]
721
+  (0.1ms) RELEASE SAVEPOINT active_record_1
722
+ Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.6ms)
723
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
724
+  (0.1ms) ROLLBACK
725
+  (0.1ms) BEGIN
726
+ --------------------------------------------------------
727
+ S3Relay::UploadsController::GET new: test_0001_anonymous
728
+ --------------------------------------------------------
729
+ Processing by S3Relay::UploadsController#new as HTML
730
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
731
+  (0.1ms) ROLLBACK
732
+  (0.1ms) BEGIN
733
+ ----------------------------------------------------------------------
734
+ S3Relay::Upload::validations::pending_at: test_0001_validates presence
735
+ ----------------------------------------------------------------------
736
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
737
+  (0.1ms) ROLLBACK
738
+  (0.1ms) BEGIN
739
+ -----------------------------------------------------------------------------------------------------------------
740
+ S3Relay::UploadsController::POST create::success::with parent attributes::matching an object: test_0001_anonymous
741
+ -----------------------------------------------------------------------------------------------------------------
742
+  (0.1ms) SAVEPOINT active_record_1
743
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 07:06:22.422753"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 07:06:22.422753"]]
744
+  (0.1ms) RELEASE SAVEPOINT active_record_1
745
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
746
+ Processing by S3Relay::UploadsController#create as HTML
747
+ Parameters: {"association"=>"photo_uploads", "uuid"=>"596ed5c9-b7d1-48ea-83bc-dcdb0d96a21f", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"3"}
748
+ Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = 3 LIMIT 1
749
+  (0.1ms) SAVEPOINT active_record_1
750
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
751
+ :value: 596ed5c9-b7d1-48ea-83bc-dcdb0d96a21f
752
+ :format: 1
753
+ ' LIMIT 1
754
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.429364"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 3], ["parent_type", "Product"], ["pending_at", "2016-12-30 07:06:22.427662"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.429364"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
755
+  (0.1ms) RELEASE SAVEPOINT active_record_1
756
+ Completed 201 Created in 5ms (Views: 0.2ms | ActiveRecord: 0.8ms)
757
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 3 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
758
+  (0.1ms) ROLLBACK
759
+  (0.1ms) BEGIN
760
+ -----------------------------------------------------
761
+ S3Relay::Upload::scopes::pending: test_0001_anonymous
762
+ -----------------------------------------------------
763
+  (0.1ms) SAVEPOINT active_record_1
764
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 07:06:22.434385"], ["data", "{}"], ["pending_at", "2016-12-30 07:06:22.434073"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.434385"]]
765
+  (0.1ms) RELEASE SAVEPOINT active_record_1
766
+  (0.1ms) SAVEPOINT active_record_1
767
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 07:06:22.436014"], ["data", "{}"], ["pending_at", "2016-12-30 07:06:22.435765"], ["state", "imported"], ["updated_at", "2016-12-30 07:06:22.436014"]]
768
+  (0.1ms) RELEASE SAVEPOINT active_record_1
769
+ S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'pending'
770
+  (0.1ms) ROLLBACK
771
+  (0.1ms) BEGIN
772
+ -----------------------------------------------------------------------------------
773
+ S3Relay::Upload::#notify_parent::when the parent is associated: test_0001_anonymous
774
+ -----------------------------------------------------------------------------------
775
+  (0.1ms) SAVEPOINT active_record_1
776
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 07:06:22.440751"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 07:06:22.440751"]]
777
+  (0.1ms) RELEASE SAVEPOINT active_record_1
778
+  (0.1ms) SAVEPOINT active_record_1
779
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
780
+ :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
781
+ :format: 1
782
+ ' LIMIT 1
783
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.443534"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 4], ["parent_type", "Product"], ["pending_at", "2016-12-30 07:06:22.440076"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.443534"], ["upload_type", "FileUpload"], ["uuid", "<36 bytes of binary data>"]]
784
+  (0.1ms) RELEASE SAVEPOINT active_record_1
785
+  (0.1ms) ROLLBACK
786
+  (0.1ms) BEGIN
787
+ --------------------------------------------------
788
+ S3Relay::Upload::#private_url: test_0001_anonymous
789
+ --------------------------------------------------
790
+  (0.1ms) ROLLBACK
791
+  (0.1ms) BEGIN
792
+  (0.1ms) COMMIT
793
+  (0.1ms) BEGIN
794
+  (0.1ms) ROLLBACK
795
+  (0.1ms) BEGIN
796
+  (0.1ms) COMMIT
797
+  (0.1ms) BEGIN
798
+  (0.1ms) ROLLBACK
799
+  (0.1ms) BEGIN
800
+  (0.1ms) COMMIT
801
+  (0.1ms) BEGIN
802
+  (0.1ms) SAVEPOINT active_record_1
803
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 07:06:22.452610"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 07:06:22.452610"]]
804
+  (0.1ms) RELEASE SAVEPOINT active_record_1
805
+  (0.1ms) SAVEPOINT active_record_1
806
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
807
+ :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
808
+ :format: 1
809
+ ' LIMIT 1
810
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.455599"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2016-12-30 07:06:22.454031"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.455599"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
811
+  (0.1ms) RELEASE SAVEPOINT active_record_1
812
+  (0.1ms) SAVEPOINT active_record_1
813
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
814
+ :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
815
+ :format: 1
816
+ ' LIMIT 1
817
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.458536"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2016-12-30 07:06:22.457100"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.458536"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
818
+  (0.1ms) RELEASE SAVEPOINT active_record_1
819
+  (0.1ms) SAVEPOINT active_record_1
820
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
821
+ :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
822
+ :format: 1
823
+ ' LIMIT 1
824
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "parent_id", "parent_type", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.461628"], ["data", "{}"], ["filename", "cat.png"], ["parent_id", 5], ["parent_type", "Product"], ["pending_at", "2016-12-30 07:06:22.460071"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.461628"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
825
+  (0.1ms) RELEASE SAVEPOINT active_record_1
826
+  (0.2ms) SELECT "s3_relay_uploads"."id" FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 5 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
827
+  (0.1ms) ROLLBACK
828
+  (0.1ms) BEGIN
829
+ -----------------------------------------------
830
+ S3Relay::Upload::#imported: test_0001_anonymous
831
+ -----------------------------------------------
832
+  (0.1ms) ROLLBACK
833
+  (0.1ms) BEGIN
834
+  (0.1ms) COMMIT
835
+  (0.1ms) BEGIN
836
+  (0.1ms) SAVEPOINT active_record_1
837
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 07:06:22.467945"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 07:06:22.467945"]]
838
+  (0.1ms) RELEASE SAVEPOINT active_record_1
839
+  (0.1ms) SAVEPOINT active_record_1
840
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
841
+ :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
842
+ :format: 1
843
+ ' LIMIT 1
844
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.470639"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 07:06:22.469260"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.470639"], ["upload_type", "IconUpload"], ["uuid", "<36 bytes of binary data>"]]
845
+  (0.1ms) RELEASE SAVEPOINT active_record_1
846
+  (0.1ms) SAVEPOINT active_record_1
847
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
848
+ :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
849
+ :format: 1
850
+ ' LIMIT 1
851
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.473469"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 07:06:22.472182"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.473469"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
852
+  (0.1ms) RELEASE SAVEPOINT active_record_1
853
+  (0.1ms) SAVEPOINT active_record_1
854
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
855
+ :value: a7c0133c-3182-4f79-a1a5-4eb1276e28d2
856
+ :format: 1
857
+ ' LIMIT 1
858
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.476073"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 07:06:22.474875"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.476073"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
859
+  (0.1ms) RELEASE SAVEPOINT active_record_1
860
+ S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
861
+ SQL (0.3ms) UPDATE "s3_relay_uploads" SET "parent_type" = 'Product', "parent_id" = 6 WHERE "s3_relay_uploads"."uuid" IN ('a7c0133c-3182-4f79-a1a5-4eb1276e28d2', 'a7c0133c-3182-4f79-a1a5-4eb1276e28d2') AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
862
+ S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."parent_type" = 'Product' AND "s3_relay_uploads"."parent_id" = 6 AND "s3_relay_uploads"."upload_type" = 'PhotoUpload'
863
+  (0.1ms) ROLLBACK
864
+  (0.1ms) BEGIN
865
+  (0.1ms) COMMIT
866
+  (0.1ms) BEGIN
867
+  (0.1ms) ROLLBACK
868
+  (0.1ms) BEGIN
869
+ -----------------------------------------------
870
+ S3Relay::Upload::#pending?: test_0001_anonymous
871
+ -----------------------------------------------
872
+  (0.1ms) ROLLBACK
873
+  (0.1ms) BEGIN
874
+ --------------------------------------------------------------------
875
+ S3Relay::Upload::validations::filename: test_0001_validates presence
876
+ --------------------------------------------------------------------
877
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
878
+  (0.1ms) ROLLBACK
879
+  (0.1ms) BEGIN
880
+  (0.1ms) COMMIT
881
+  (0.1ms) BEGIN
882
+  (0.2ms) ROLLBACK
883
+  (0.1ms) BEGIN
884
+ ---------------------------------------------------------------------------------
885
+ S3Relay::UploadsHelper::#s3_relay_field::with multiple: true: test_0001_anonymous
886
+ ---------------------------------------------------------------------------------
887
+  (0.1ms) SAVEPOINT active_record_1
888
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 07:06:22.492146"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 07:06:22.492146"]]
889
+  (0.1ms) RELEASE SAVEPOINT active_record_1
890
+  (0.1ms) ROLLBACK
891
+  (0.1ms) BEGIN
892
+ ---------------------------------------------------------------------
893
+ S3Relay::UploadsController::POST create::success: test_0001_anonymous
894
+ ---------------------------------------------------------------------
895
+  (0.3ms) SELECT COUNT(*) FROM "s3_relay_uploads"
896
+ Processing by S3Relay::UploadsController#create as HTML
897
+ Parameters: {"association"=>"photo_uploads", "uuid"=>"b297276c-e024-4391-a5a5-b71fc5199c25", "filename"=>"cat.png", "content_type"=>"image/png"}
898
+  (0.1ms) SAVEPOINT active_record_1
899
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
900
+ :value: b297276c-e024-4391-a5a5-b71fc5199c25
901
+ :format: 1
902
+ ' LIMIT 1
903
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.501753"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 07:06:22.500393"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.501753"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
904
+  (0.1ms) RELEASE SAVEPOINT active_record_1
905
+ Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.6ms)
906
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
907
+  (0.1ms) ROLLBACK
908
+  (0.1ms) BEGIN
909
+ ----------------------------------------------------------------
910
+ S3Relay::Upload::validations::uuid: test_0001_validates presence
911
+ ----------------------------------------------------------------
912
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
913
+  (0.1ms) ROLLBACK
914
+  (0.1ms) BEGIN
915
+ ------------------------------------------------------------------
916
+ S3Relay::Upload::validations::uuid: test_0002_validates uniqueness
917
+ ------------------------------------------------------------------
918
+  (0.1ms) SAVEPOINT active_record_1
919
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 07:06:22.509229"], ["data", "{}"], ["pending_at", "2016-12-30 07:06:22.508956"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.509229"]]
920
+  (0.1ms) RELEASE SAVEPOINT active_record_1
921
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
922
+  (0.2ms) ROLLBACK
923
+  (0.1ms) BEGIN
924
+ ------------------------------------------------------
925
+ S3Relay::Upload::scopes::imported: test_0001_anonymous
926
+ ------------------------------------------------------
927
+  (0.1ms) SAVEPOINT active_record_1
928
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 07:06:22.515073"], ["data", "{}"], ["pending_at", "2016-12-30 07:06:22.514743"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.515073"]]
929
+  (0.1ms) RELEASE SAVEPOINT active_record_1
930
+  (0.1ms) SAVEPOINT active_record_1
931
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("created_at", "data", "pending_at", "state", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", "2016-12-30 07:06:22.516566"], ["data", "{}"], ["pending_at", "2016-12-30 07:06:22.516321"], ["state", "imported"], ["updated_at", "2016-12-30 07:06:22.516566"]]
932
+  (0.1ms) RELEASE SAVEPOINT active_record_1
933
+ S3Relay::Upload Load (0.2ms) SELECT "s3_relay_uploads".* FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."state" = 'imported'
934
+  (0.1ms) ROLLBACK
935
+  (0.1ms) BEGIN
936
+  (0.1ms) COMMIT
937
+  (0.1ms) BEGIN
938
+  (0.1ms) ROLLBACK
939
+  (0.2ms) BEGIN
940
+ -----------------------------------------------------------------------------
941
+ S3Relay::UploadsHelper::#s3_relay_field::without options: test_0001_anonymous
942
+ -----------------------------------------------------------------------------
943
+  (0.1ms) SAVEPOINT active_record_1
944
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", "2016-12-30 07:06:22.525326"], ["name", "Flux Capacitor"], ["updated_at", "2016-12-30 07:06:22.525326"]]
945
+  (0.1ms) RELEASE SAVEPOINT active_record_1
946
+  (0.1ms) ROLLBACK
947
+  (0.1ms) BEGIN
948
+ ---------------------------------------------------------------------------------------------------------------------
949
+ S3Relay::UploadsController::POST create::success::with parent attributes::not matching an object: test_0001_anonymous
950
+ ---------------------------------------------------------------------------------------------------------------------
951
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
952
+ Processing by S3Relay::UploadsController#create as HTML
953
+ Parameters: {"association"=>"photo_uploads", "uuid"=>"1d707eb2-1f02-4a89-ad8e-4d467a3e28ce", "filename"=>"cat.png", "content_type"=>"image/png", "parent_type"=>"Product", "parent_id"=>"10000000"}
954
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = 10000000 LIMIT 1
955
+  (0.1ms) SAVEPOINT active_record_1
956
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" = '---
957
+ :value: 1d707eb2-1f02-4a89-ad8e-4d467a3e28ce
958
+ :format: 1
959
+ ' LIMIT 1
960
+ SQL (0.2ms) INSERT INTO "s3_relay_uploads" ("content_type", "created_at", "data", "filename", "pending_at", "state", "updated_at", "upload_type", "uuid") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["content_type", "image/png"], ["created_at", "2016-12-30 07:06:22.533979"], ["data", "{}"], ["filename", "cat.png"], ["pending_at", "2016-12-30 07:06:22.532714"], ["state", "pending"], ["updated_at", "2016-12-30 07:06:22.533979"], ["upload_type", "PhotoUpload"], ["uuid", "<36 bytes of binary data>"]]
961
+  (0.1ms) RELEASE SAVEPOINT active_record_1
962
+ Completed 201 Created in 4ms (Views: 0.2ms | ActiveRecord: 0.7ms)
963
+  (0.2ms) SELECT COUNT(*) FROM "s3_relay_uploads"
964
+  (0.1ms) ROLLBACK
965
+  (0.1ms) BEGIN
966
+ -------------------------------------------------------
967
+ S3Relay::Upload::upon finalization: test_0001_anonymous
968
+ -------------------------------------------------------
969
+  (0.1ms) ROLLBACK
970
+  (0.1ms) BEGIN
971
+ ------------------------------------------------------------------------
972
+ S3Relay::Upload::validations::content_type: test_0001_validates presence
973
+ ------------------------------------------------------------------------
974
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
975
+  (0.1ms) ROLLBACK
976
+  (0.1ms) BEGIN
977
+ ----------------------------------------------------------
978
+ S3Relay::Upload::associations::parent: test_0001_anonymous
979
+ ----------------------------------------------------------
980
+  (0.1ms) ROLLBACK
981
+  (0.1ms) BEGIN
982
+ -----------------------------------------------------
983
+ S3Relay::Upload::#mark_imported!: test_0001_anonymous
984
+ -----------------------------------------------------
985
+  (0.1ms) SAVEPOINT active_record_1
986
+ S3Relay::Upload Exists (0.2ms) SELECT 1 AS one FROM "s3_relay_uploads" WHERE "s3_relay_uploads"."uuid" IS NULL LIMIT 1
987
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
988
+  (0.1ms) ROLLBACK
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3_relay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenny Johnston