activestorage-delayed 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/activestorage-delayed/models/delayed_upload.rb +1 -1
- data/lib/activestorage-delayed/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76f19f1856294d83f52a92dbbc1ea9eb52c216c021726437ff513727426c65e4
|
4
|
+
data.tar.gz: 923f537ec4dbbfd797c72157f46b58a1a1f20f04127f53034f444fd6a2cd8ac2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea37e642bef6ef9ba231b0bc0b2c8c1676b569679be5373bd45cd5f6cbd7f8aff4d1ac3642e1f6853fddf8e46f55f19293a38cf9fee4a60061b671c5cb27a3b0
|
7
|
+
data.tar.gz: 80d2123dec2953c7c8778e0f7fa9449e73b7f25625863e05f0edaf5c07e3c6782c3e4b44f824c14ab61bb3dc03a834ec94c6eebc340b298fb7061d11f02208fe
|
data/README.md
CHANGED
@@ -39,7 +39,7 @@ Note: This gem assumes that the app has already configured activestorage.
|
|
39
39
|
class User < ApplicationRecord
|
40
40
|
include ActivestorageDelayed::DelayedConcern
|
41
41
|
|
42
|
-
has_one_attached :photo,
|
42
|
+
has_one_attached :photo, required: true, use_filename: true
|
43
43
|
delayed_attach :photo
|
44
44
|
|
45
45
|
has_many_attached :certificates
|
@@ -48,7 +48,7 @@ end
|
|
48
48
|
|
49
49
|
```
|
50
50
|
### `delayed_attach` accepts an optional hash with the following options:
|
51
|
-
- `
|
51
|
+
- `required`: If set to `true`, the `photo` or the `photo_tmp` will be required before saving.
|
52
52
|
- `use_filename`: If set to `true`, the image filename will be used as the name of uploaded file instead of the hash-key used by `activestorage`
|
53
53
|
|
54
54
|
### Examples to upload files in background
|
@@ -10,7 +10,7 @@ module ActivestorageDelayed
|
|
10
10
|
self.table_name = 'activestorage_delayed_uploads'
|
11
11
|
attr_accessor :tmp_files
|
12
12
|
|
13
|
-
belongs_to :uploadable, polymorphic: true
|
13
|
+
belongs_to :uploadable, polymorphic: true, touch: true
|
14
14
|
|
15
15
|
before_save :parse_tmp_files
|
16
16
|
after_create_commit do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activestorage-delayed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Owen Peredo Diaz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04
|
11
|
+
date: 2022-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activestorage
|