effective_bootstrap 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c99ee9149a14d12b358d091ad6cebb80daf48170b609911e12d219d7ce5419af
4
- data.tar.gz: 70107ccde4ca9fb2b7913ed8f262c8086cd15889bb27e79d4c4ba4c1f22f95d4
3
+ metadata.gz: 0ca6a774b911ab73f075f9981ad5f1ebc88a41d00409665e5a0fdd404e7c2d4a
4
+ data.tar.gz: 2d97baf8f07f894209b679505bfb82e4a3e1b753a321ba0f38f4c5187f822975
5
5
  SHA512:
6
- metadata.gz: c4b8aa210f3a582a110c1eca6959c6238c5f897381126b958f584cea4d51e60f7218435a113c0e50b4031a1f7cf6bc39b7ab1b3cfdcfe276b33c5f1a5f511485
7
- data.tar.gz: 5ec8f4f333bb7e7ac46fdeaf1d47583b38732ddfbb157390efa9968b140a0640f35c7734b905d901d89247ad957110b557b3fed5122425666ca4242eeda08edd
6
+ metadata.gz: 3530d0ccd7a0db06f3b5a76dd1158139a0b1b6b638cce635dea5533bcc7cd93f20896868bbd36a9b341e9cf23a0dff8ca1bb4d25bd79608403f635f3734faad9
7
+ data.tar.gz: 140da48f3f67b3fb1b4fbdacaefad449313b37f1df3a4123e366dce6ae29b20be9ec45db64cccb3f831fb820ed562d7f343705146da43a31d7eff97dc8a7bf2d
@@ -5,9 +5,9 @@ module Effective
5
5
  def build_input(&block)
6
6
  case attachments_style
7
7
  when :card
8
- build_attachments + build_uploads + super
8
+ build_existing_attachments + build_attachments + build_uploads + super
9
9
  when :table, :ck_assets
10
- super + build_uploads + build_attachments
10
+ super + build_existing_attachments + build_uploads + build_attachments
11
11
  else
12
12
  raise('unsupported attachments_style, try :card or :table')
13
13
  end
@@ -32,6 +32,16 @@ module Effective
32
32
  super(obj, name) && Array(object.public_send(name)).length == 0
33
33
  end
34
34
 
35
+ def build_existing_attachments
36
+ return ''.html_safe unless multiple?
37
+
38
+ attachments = object.send(name)
39
+
40
+ attachments.map.with_index do |attachment, index|
41
+ @builder.hidden_field(name, multiple: true, id: (tag_id + "_#{index}"), value: attachment.signed_id)
42
+ end.join.html_safe
43
+ end
44
+
35
45
  def build_attachments
36
46
  return ''.html_safe unless object.respond_to?(name) && object.send(name).respond_to?(:attached?) && object.send(name).attached?
37
47
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.9.5'.freeze
2
+ VERSION = '0.9.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-28 00:00:00.000000000 Z
11
+ date: 2020-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails