bmc 1.4.3 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/app/filters/bmc/filter/by_key_value.rb +2 -2
- data/app/helpers/bmc/button_helper.rb +15 -2
- data/app/jobs/concerns/bmc/setup_job_concern.rb +1 -1
- data/app/models/concerns/bmc/default_values_concern.rb +1 -1
- data/app/models/concerns/bmc/model_to_s.rb +1 -1
- data/app/models/concerns/bmc/search.rb +1 -1
- data/lib/bmc/active_model_type_cast.rb +5 -5
- data/lib/bmc/form_back_url.rb +1 -1
- data/lib/bmc/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66917c46eb778377885fb86604c50632bc8e9d9c51a2974da48ffb4a30417567
|
4
|
+
data.tar.gz: d53cf1ba56317ebe9789806270a408441690cc55d28ef87b9d0f4f3a0d7e9a64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a38bde69e6cc4a9ad5187eade8fecd53f76d193d36d417a67c1eb46c1ac9283d3d94d6a3f473ac3d0ba4dc97e4bcaf60e1dcff0103c3e9c9d9673a46d705c1e
|
7
|
+
data.tar.gz: 1dcc4a6a907c341dc93e36ab4f7bb81821f92523f8b86b4caa2fc854a76c334767ce49e437fcdc87c7c1bb73d30e4fd9b5eef774925375862d48b3a8f2ac1ac4
|
data/CHANGELOG.md
CHANGED
@@ -14,9 +14,9 @@ class BMC::Filter::ByKeyValue
|
|
14
14
|
|
15
15
|
column = column_for(query)
|
16
16
|
|
17
|
-
if value.to_s.in?(%w
|
17
|
+
if value.to_s.in?(%w[nil null])
|
18
18
|
query.where("#{column} IS NULL")
|
19
|
-
elsif value.to_s.in?(%w
|
19
|
+
elsif value.to_s.in?(%w[not_nil not_null])
|
20
20
|
query.where("#{column} IS NOT NULL")
|
21
21
|
else
|
22
22
|
query.where("#{column} = ?", value)
|
@@ -9,6 +9,14 @@ module BMC::ButtonHelper
|
|
9
9
|
def default_style
|
10
10
|
@default_style ||= :outline_primary
|
11
11
|
end
|
12
|
+
|
13
|
+
def confirm_attribute
|
14
|
+
@confirm_attribute ||= :"data-turbo-confirm"
|
15
|
+
end
|
16
|
+
|
17
|
+
def method_attribute
|
18
|
+
@method_attribute ||= :"data-turbo-method"
|
19
|
+
end
|
12
20
|
end
|
13
21
|
|
14
22
|
def bs_button( # rubocop:disable Metrics/ParameterLists
|
@@ -30,7 +38,12 @@ module BMC::ButtonHelper
|
|
30
38
|
content = fa_s(icon).concat(" ").concat(tag.span(text, class: "text"))
|
31
39
|
|
32
40
|
if method != :get
|
33
|
-
|
41
|
+
if helper == :link_to
|
42
|
+
options[BMC::ButtonHelper.method_attribute] = method
|
43
|
+
options[:rel] = "nofollow"
|
44
|
+
elsif helper == :button_to
|
45
|
+
options[:method] = method
|
46
|
+
end
|
34
47
|
confirm = true if confirm.nil?
|
35
48
|
end
|
36
49
|
|
@@ -48,7 +61,7 @@ module BMC::ButtonHelper
|
|
48
61
|
|
49
62
|
unless confirm.nil?
|
50
63
|
confirm = ta(:confirm) if confirm == true
|
51
|
-
options.
|
64
|
+
options[BMC::ButtonHelper.confirm_attribute] = confirm
|
52
65
|
end
|
53
66
|
|
54
67
|
public_send(helper, content, url, options.sort.to_h)
|
@@ -20,7 +20,7 @@ module BMC::Search
|
|
20
20
|
}.join(" OR ")
|
21
21
|
}.map { |e| "(#{e})" }.join(" AND ")
|
22
22
|
|
23
|
-
sql_params = words.map.with_index { |word, index| ["w#{index}"
|
23
|
+
sql_params = words.map.with_index { |word, index| [:"w#{index}", "%#{word}%"] }.to_h
|
24
24
|
|
25
25
|
where(sql_query, sql_params)
|
26
26
|
end # def search
|
@@ -2,9 +2,9 @@ module BMC::ActiveModelTypeCast
|
|
2
2
|
module Decimal
|
3
3
|
def cast_value(value)
|
4
4
|
if value.is_a?(String)
|
5
|
-
super
|
5
|
+
super(value.tr(",", ".").gsub(/[^-0-9.]/, ""))
|
6
6
|
else
|
7
|
-
super
|
7
|
+
super(value)
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -19,9 +19,9 @@ module BMC::ActiveModelTypeCast
|
|
19
19
|
|
20
20
|
def cast_value(value)
|
21
21
|
if sanitizable?(value)
|
22
|
-
super
|
22
|
+
super(sanitize(value))
|
23
23
|
else
|
24
|
-
super
|
24
|
+
super(value)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -41,7 +41,7 @@ module BMC::ActiveModelTypeCast
|
|
41
41
|
module Boolean
|
42
42
|
def cast_value(value)
|
43
43
|
value = value.strip if value.is_a?(String)
|
44
|
-
super
|
44
|
+
super(value)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
data/lib/bmc/form_back_url.rb
CHANGED
data/lib/bmc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bmc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benoit MARTIN-CHAVE
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails-i18n
|
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
230
|
- !ruby/object:Gem::Version
|
231
231
|
version: '0'
|
232
232
|
requirements: []
|
233
|
-
rubygems_version: 3.
|
233
|
+
rubygems_version: 3.5.6
|
234
234
|
signing_key:
|
235
235
|
specification_version: 4
|
236
236
|
summary: BMC
|