tessa 6.0.0.rc1 → 6.0.0.rc2

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
  SHA256:
3
- metadata.gz: 033f87d750a6bb05ca27e653b62c4b0f5abe9a13a30226e0e874173a90091d22
4
- data.tar.gz: b299e641d1c47faf81d70a9f11b74627015b50776a9c16ed26a6012c23a99048
3
+ metadata.gz: 20d746d445cccc01d998f1d8bead8b92b8e0083e1858cd40ed2151785c1f4830
4
+ data.tar.gz: aa0432076ee14f238af2bf5cffdc83a0f37055246a1524ae2a05cb48e5bb3ed4
5
5
  SHA512:
6
- metadata.gz: fa737da8ef768d7091b81fc5175edd746e4ed8eac5c8453157d6d0621920f90f6005a29ae40c98d2ce03e732ac79c5dc83eba8fd90233804d65b14b701599dd4
7
- data.tar.gz: bf534fec4385f7e6ab38e333cfabde983268b6d501a8beea638021b88310a973f3cdef499818eee046e0061d198d158f31221453afd2612e2892c5b614a20800
6
+ metadata.gz: 386f143532a9e1a17b7149488d6d50d2affa444a3fc029653c5dca2218eef980df1963982cc64020b7aca85c7fbd7063e19a23fa0355cdebc4a0881230715585
7
+ data.tar.gz: f504a6ae2e98ee85478bb5d89ddb950533c80aa5a881f7accb336dfd36049eea8b1336c5a9f602ff6b51a4085826d76104475e3af9fdb8e17fdb0b7160a177f6
data/README.md CHANGED
@@ -23,6 +23,12 @@ When that migration is completed, v2.x of this gem will remove all code that acc
23
23
  will transition to being simply a convenience wrapper around ActiveStorage, so that we don't have to re-write as much
24
24
  of our code in our frontend apps.
25
25
 
26
+ v6.x of this gem is compatible with ActiveStorage v6 and above. Since v6, ActiveStorage now does everything that this
27
+ gem used to do, with the exception of Dropzone integration. Therefore, tessa-client v6 only contains the following
28
+ two modules:
29
+ 1. A set of Javascript utilities to integrate Dropzone.js with ActiveStorage direct uploads
30
+ 2. A SimpleForm helper to write out the hidden input fields for an ActiveStorage `has_one_attached`.
31
+
26
32
  ## Installation
27
33
 
28
34
  Add this line to your application's Gemfile:
@@ -61,17 +67,7 @@ from the user's browser.
61
67
 
62
68
  To get all this working, follow these steps:
63
69
 
64
- 1. Mount the engine
65
- in your `config/routes.rb`, `mount Tessa::Engine, at: '/'`. It's important that it is mounted at root.
66
-
67
- You can use Authentication around the engine to prevent unauthorized uploads. With devise it's as simple as:
68
- ```rb
69
- authenticated :user do
70
- mount Tessa::Engine, at: '/'
71
- end
72
- ```
73
-
74
- 2. In your application.js, require the js libraries:
70
+ 1. In your application.js, require the js libraries:
75
71
  ```js
76
72
  //= require dropzone
77
73
  //= require tessa
@@ -79,16 +75,14 @@ You can use Authentication around the engine to prevent unauthorized uploads. W
79
75
  Note that this only works if you are using Sprockets.
80
76
  If you are using another bundler, we don't support that yet.
81
77
 
82
- 3. Ensure you configure your model with ActiveStorage
78
+ 2. use ActiveStorage to add an attached asset
83
79
 
84
80
  ```rb
85
81
  class Model < ApplicationRecord
86
- include Tessa::Model
87
-
88
82
  has_one_attached :image
89
83
  ```
90
84
 
91
- 4. When rendering your form, use the SimpleForm helper to render the dropzone div:
85
+ 3. When rendering your form, use the SimpleForm helper to render the dropzone div:
92
86
 
93
87
  ```erb
94
88
  <%= f.input :image,
@@ -97,7 +91,7 @@ class Model < ApplicationRecord
97
91
  hint: "Use an image that is 1440 x 288 in size (5:1 aspect ratio)" %>
98
92
  ```
99
93
 
100
- 5. Configure your ActiveStorage service to accept direct uploads.
94
+ 4. Configure your ActiveStorage service to accept direct uploads.
101
95
  The disk service does this automatically. The S3 service requires additional CORS configuration.
102
96
 
103
97
  ## Contributing
@@ -18,7 +18,7 @@ module Tessa
18
18
  def hidden_fields_for(attribute_name)
19
19
  asset = object.public_send(attribute_name)
20
20
  unless asset&.key.present?
21
- return @builder.hidden_field("#{attribute_name}")
21
+ return @builder.hidden_field("#{attribute_name}", value: nil)
22
22
  end
23
23
 
24
24
  @builder.hidden_field("#{attribute_name}",
data/lib/tessa/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tessa
2
- VERSION = "6.0.0.rc1"
2
+ VERSION = "6.0.0.rc2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tessa
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.rc1
4
+ version: 6.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Powell
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-04-17 00:00:00.000000000 Z
12
+ date: 2023-05-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake