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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/normal_attachment.rb +8 -11
  3. metadata +3 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 293d0945bd8541520b5d5f2e0469042105c156d7efebb93d638b02357d82911b
4
- data.tar.gz: f39424390ef7827c0c958791bc7619ecb5bd977f2c9138727ab5155c0367d5e9
3
+ metadata.gz: ad9d4cb1e84c8454e7658e30dd00c823e58dfdc3f1a69e245eb2455bee004b56
4
+ data.tar.gz: 59cd690a140dfcba8bd71f3656cb23d3965b43f21247f20ee3c769c1b5f2e3a1
5
5
  SHA512:
6
- metadata.gz: 18d27fdc6c888c817a6b08e3c7dde318b26d999bb812e9bbd32101572c7b1427f94807123a2cbc3ac80f238da7cd1e6384ab8e8a443a5e5d379531ab6676bbf7
7
- data.tar.gz: 6c115914f915bc25780bf8771ef5ba5fcabc95c8cf7c04e2a0bae8cd887d375795c3532aef41558737e68dd458be67ed8f90b9f819bcb3ac608ac50baa2ac880
6
+ metadata.gz: 421c57279fa9ca212d72e6437d6853fada27bd08ed88f4e084d8d1a079ae59b4e7a8d608bb9044550b66baf9c8c008e024956c756bddead2387be44d9bc3a41d
7
+ data.tar.gz: 3844a272e06f923f4877a6a87c75b5b8a5b185734d366b3c1d808e57f2a13aec3f04c37327640ab16cdeb279a44c73fb5439edfc0e3ea2e19d48de02614b2114
@@ -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
- # Para agradar o painel do admin:
13
-
14
- # 0. o nome do has_one_attched ser attachment
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
- # 1. poder chamar url direto no modelo e nao no attachment
17
- def url opcoes_do_spree
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
- return {:attachment => {styles: { original: '48x48>'}, default_stle: "original"}}
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.1
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: 2024-06-24 00:00:00.000000000 Z
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.4.10
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: []