agilibox 1.9.17 → 1.9.18
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/models/concerns/agilibox/search.rb +2 -0
- data/lib/agilibox/active_model_custom_error_messages.rb +20 -5
- data/lib/agilibox/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: 6aefdff535a2d584ecfee6f6ff392506fe81231df048b8001568203363c25b23
|
4
|
+
data.tar.gz: 3a8b08504c485d4d49feff5105457b6de694399f263d791e87cea0f2132fd62a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f87086447d9013cb86f0abb83a17dc2c21b85c926cf05cb2a6f142cbb32e03877438976a1f85f0575bdb650d4e0ea0f7a4dc280d3b2a39ed43514a6e9f8a1e99
|
7
|
+
data.tar.gz: 0ce28dbcb3994f4aba0c5894e4e54e660b3753cf6335ac8d1a33f7dcb8df09c636368514bbecd8be78d840a96b296b985590147234a6ff9fac63e9d68570291c
|
data/CHANGELOG.md
CHANGED
@@ -12,6 +12,8 @@ module Agilibox::Search
|
|
12
12
|
words = q.to_s.parameterize.split("-")
|
13
13
|
fields = default_search_fields if fields.empty?
|
14
14
|
|
15
|
+
return all if words.empty?
|
16
|
+
|
15
17
|
sql_query = words.map.with_index { |_word, index|
|
16
18
|
fields.map { |field|
|
17
19
|
"(UNACCENT(CAST(#{field} AS TEXT)) ILIKE :w#{index})"
|
@@ -1,8 +1,23 @@
|
|
1
1
|
module Agilibox::ActiveModelCustomErrorMessages
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
# Rails <= 6.0
|
3
|
+
module ForErrors
|
4
|
+
def full_message(attribute, message)
|
5
|
+
return message[1..] if message[0] == "^"
|
6
|
+
super
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
ActiveModel::Errors.prepend(ForErrors)
|
11
|
+
|
12
|
+
# Rails >= 6.1
|
13
|
+
module ForError
|
14
|
+
def full_message
|
15
|
+
return message[1..] if message[0] == "^"
|
16
|
+
super
|
17
|
+
end
|
5
18
|
end
|
6
|
-
end
|
7
19
|
|
8
|
-
|
20
|
+
if Module.const_defined?("ActiveModel::Error")
|
21
|
+
ActiveModel::Error.prepend(ForError)
|
22
|
+
end
|
23
|
+
end
|
data/lib/agilibox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: agilibox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- agilidée
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails-i18n
|
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
244
244
|
- !ruby/object:Gem::Version
|
245
245
|
version: '0'
|
246
246
|
requirements: []
|
247
|
-
rubygems_version: 3.1.
|
247
|
+
rubygems_version: 3.1.6
|
248
248
|
signing_key:
|
249
249
|
specification_version: 4
|
250
250
|
summary: Agilibox
|