normal_attachment 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/normal_attachment.rb +30 -0
  3. metadata +58 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 293d0945bd8541520b5d5f2e0469042105c156d7efebb93d638b02357d82911b
4
+ data.tar.gz: f39424390ef7827c0c958791bc7619ecb5bd977f2c9138727ab5155c0367d5e9
5
+ SHA512:
6
+ metadata.gz: 18d27fdc6c888c817a6b08e3c7dde318b26d999bb812e9bbd32101572c7b1427f94807123a2cbc3ac80f238da7cd1e6384ab8e8a443a5e5d379531ab6676bbf7
7
+ data.tar.gz: 6c115914f915bc25780bf8771ef5ba5fcabc95c8cf7c04e2a0bae8cd887d375795c3532aef41558737e68dd458be67ed8f90b9f819bcb3ac608ac50baa2ac880
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NormalAttachment
4
+ module Image
5
+ extend ActiveSupport::Concern
6
+
7
+ included do
8
+ validates :attachment, presence: true
9
+ has_one_attached :attachment
10
+ end
11
+
12
+ # Para agradar o painel do admin:
13
+
14
+ # 0. o nome do has_one_attched ser attachment
15
+
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
21
+ end
22
+
23
+ # 2. pegar uma lista de estilos na classe Spree::Image
24
+ class_methods do
25
+ def attachment_definitions
26
+ return {:attachment => {styles: { original: '48x48>'}, default_stle: "original"}}
27
+ end
28
+ end
29
+ end
30
+ end
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: normal_attachment
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Felipe Mesquita
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-06-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: minitest
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5.0'
27
+ description: Ignores all styles and compatibility with paperclip
28
+ email: felipemesquita@hey.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - lib/normal_attachment.rb
34
+ homepage: https://github.com/felipedmesquita/normal_attachment
35
+ licenses:
36
+ - MIT
37
+ metadata:
38
+ source_code_uri: https://github.com/felipedmesquita/normal_attachment
39
+ post_install_message:
40
+ rdoc_options: []
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ requirements: []
54
+ rubygems_version: 3.4.10
55
+ signing_key:
56
+ specification_version: 4
57
+ summary: Simpler attachment for using ActiveStorage with Solidus
58
+ test_files: []