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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d915e06c7f404c90124074fbd3d6cd670b6a518f7e9bf770be57b3ff8578016c
4
- data.tar.gz: 4296515fd57d0d3d184dfb0907f32e4924afbc95e023cf210b6f2c4d3b87e08a
3
+ metadata.gz: 6aefdff535a2d584ecfee6f6ff392506fe81231df048b8001568203363c25b23
4
+ data.tar.gz: 3a8b08504c485d4d49feff5105457b6de694399f263d791e87cea0f2132fd62a
5
5
  SHA512:
6
- metadata.gz: 15a09252e2808322e8b764b0c48c2baf25574818af6d149dd35d7ab83c00ebc7738e8a4fada25bee183534fdeae3d5b01acc85bdc0673b56fe4f8bbd807beda7
7
- data.tar.gz: 5e2827c129f389a9a43ece6ec345784f589d0b609270a5f8730c85c89107c2d267c9aa2184f5e4d8f1b1ecae5865443ecb5a1438c6eac67679fb6d48bc8b63ae
6
+ metadata.gz: f87086447d9013cb86f0abb83a17dc2c21b85c926cf05cb2a6f142cbb32e03877438976a1f85f0575bdb650d4e0ea0f7a4dc280d3b2a39ed43514a6e9f8a1e99
7
+ data.tar.gz: 0ce28dbcb3994f4aba0c5894e4e54e660b3753cf6335ac8d1a33f7dcb8df09c636368514bbecd8be78d840a96b296b985590147234a6ff9fac63e9d68570291c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ ## v1.9.18
6
+ - Rails 6.1 compatibility
7
+
5
8
  ## v1.9.17
6
9
  - Fix capybara selector
7
10
 
@@ -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
- def full_message(attribute, message)
3
- return message[1..] if message[0] == "^"
4
- super(attribute, message)
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
- ActiveModel::Errors.prepend(Agilibox::ActiveModelCustomErrorMessages)
20
+ if Module.const_defined?("ActiveModel::Error")
21
+ ActiveModel::Error.prepend(ForError)
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module Agilibox
2
- VERSION = "1.9.17"
2
+ VERSION = "1.9.18"
3
3
  end
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.17
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-02-13 00:00:00.000000000 Z
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.4
247
+ rubygems_version: 3.1.6
248
248
  signing_key:
249
249
  specification_version: 4
250
250
  summary: Agilibox