effective_bootstrap 0.0.13 → 0.0.14
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 381cb46d720fac97c73a41804a42238d4a871182
|
4
|
+
data.tar.gz: c570ae902eda1639f33624e4f9d8b257bcad856b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00268cb9c16ddbe1bf8811e51e7565cbcbbf0e6ceddd78eb927cc3eec76d0c12b8153f34b52ff85aa7d568e7244e546a712b4d67f30672cae8d7438e83c162cb
|
7
|
+
data.tar.gz: 149156b84bdbb38aeb2f36fa8acc2cd00c20de63b4c09b33e9492219b827637b8d35f3ee5fcd23d853a7cd8f4328288b56d886f008f674e840da8294ac662fb2
|
@@ -178,7 +178,10 @@ module Effective
|
|
178
178
|
obj = (object.class == Class) ? object : object.class
|
179
179
|
return false unless obj.respond_to?(:validators_on)
|
180
180
|
|
181
|
-
obj.validators_on(name).any?
|
181
|
+
obj.validators_on(name).any? do |v|
|
182
|
+
v.kind_of?(ActiveRecord::Validations::PresenceValidator) && !v.options.key?(:if) && !v.options.key?(:unless)
|
183
|
+
end
|
184
|
+
|
182
185
|
end
|
183
186
|
|
184
187
|
def validated?(name)
|
@@ -28,13 +28,14 @@ module Effective
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def build_attachment(attachment)
|
31
|
-
url = @template.url_for(attachment)
|
31
|
+
url = (@template.url_for(attachment) rescue false)
|
32
|
+
return unless url
|
32
33
|
|
33
|
-
content_tag(:div, class: 'col
|
34
|
+
content_tag(:div, class: 'col') do
|
34
35
|
content_tag(:div, class: 'card mb-3') do
|
35
36
|
if attachment.image?
|
36
|
-
content_tag(:img, '', class: 'card-img-top', src: url, alt: attachment.filename.to_s) +
|
37
37
|
content_tag(:div, class: 'card-body') do
|
38
|
+
content_tag(:img, '', class: 'img-fluid', src: url, alt: attachment.filename.to_s) +
|
38
39
|
link_to(attachment.filename, url, class: 'card-link')
|
39
40
|
end
|
40
41
|
else
|
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.0.
|
4
|
+
version: 0.0.14
|
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: 2018-05-
|
11
|
+
date: 2018-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|