normal_attachment 0.0.1 → 0.0.3
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 +4 -4
- data/lib/normal_attachment.rb +8 -11
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad9d4cb1e84c8454e7658e30dd00c823e58dfdc3f1a69e245eb2455bee004b56
|
4
|
+
data.tar.gz: 59cd690a140dfcba8bd71f3656cb23d3965b43f21247f20ee3c769c1b5f2e3a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 421c57279fa9ca212d72e6437d6853fada27bd08ed88f4e084d8d1a079ae59b4e7a8d608bb9044550b66baf9c8c008e024956c756bddead2387be44d9bc3a41d
|
7
|
+
data.tar.gz: 3844a272e06f923f4877a6a87c75b5b8a5b185734d366b3c1d808e57f2a13aec3f04c37327640ab16cdeb279a44c73fb5439edfc0e3ea2e19d48de02614b2114
|
data/lib/normal_attachment.rb
CHANGED
@@ -5,25 +5,22 @@ module NormalAttachment
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
included do
|
8
|
-
validates :attachment, presence: true
|
9
8
|
has_one_attached :attachment
|
9
|
+
validates :attachment, presence: true
|
10
10
|
end
|
11
11
|
|
12
|
-
#
|
13
|
-
|
14
|
-
#
|
12
|
+
# Solidus Admin/Backend requirements:
|
13
|
+
# - attachment name must be 'attachment'
|
14
|
+
# - a :url method defined on the model instances that takes options (size)
|
15
|
+
# - a class method :attachment_definitions that returns a hash in this format (apparently not used)
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
puts "spree chamou url com esses argumetnos:"
|
19
|
-
puts opcoes_do_spree.inspect
|
20
|
-
attachment.url
|
17
|
+
def url spree_options=nil
|
18
|
+
attachment.url
|
21
19
|
end
|
22
20
|
|
23
|
-
# 2. pegar uma lista de estilos na classe Spree::Image
|
24
21
|
class_methods do
|
25
22
|
def attachment_definitions
|
26
|
-
|
23
|
+
{attachment: {styles: {original: "48x48>"}, default_stle: "original"}}
|
27
24
|
end
|
28
25
|
end
|
29
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: normal_attachment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felipe Mesquita
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-05-16 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: minitest
|
@@ -36,7 +35,6 @@ licenses:
|
|
36
35
|
- MIT
|
37
36
|
metadata:
|
38
37
|
source_code_uri: https://github.com/felipedmesquita/normal_attachment
|
39
|
-
post_install_message:
|
40
38
|
rdoc_options: []
|
41
39
|
require_paths:
|
42
40
|
- lib
|
@@ -51,8 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
49
|
- !ruby/object:Gem::Version
|
52
50
|
version: '0'
|
53
51
|
requirements: []
|
54
|
-
rubygems_version: 3.
|
55
|
-
signing_key:
|
52
|
+
rubygems_version: 3.6.5
|
56
53
|
specification_version: 4
|
57
54
|
summary: Simpler attachment for using ActiveStorage with Solidus
|
58
55
|
test_files: []
|