vidibus-permalink 1.1.2 → 1.1.3

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: f00dec174def77cba9500663b540a6ffc8cf7a0b
4
- data.tar.gz: fd3d2f0a87f99dd7c36ddec51003ee2fa17bf059
3
+ metadata.gz: 515aa963b43b3d2cdf4576dfe00e9e8ddee3b819
4
+ data.tar.gz: 5d7edb952308577f1d5b0a2893df325bf26d08c8
5
5
  SHA512:
6
- metadata.gz: '0915a7c00cdf3e4212c24f13fc4bb044222230473f56a44c4efd49d3457d2b5e37be1b95fcf52f2469eefcd2e4a5ebc35b55349de44370a50286f94612ca4104'
7
- data.tar.gz: 1bae7199adbea407806612f98f15e60f26d84065c29de92e23c81138c6b1950998b6eb2f4e4ac41371442c42e29486be949b5a058474151976480a617c060a26
6
+ metadata.gz: eaf165cd78288a6cb4ab0933b4d1c82b6a13954637b0ebb5bbbcf1549187a9b80b370c15e3b56afea9057ea290066bb0018378c489ce584b43a97537d51a420b
7
+ data.tar.gz: 426bb22b0fa89969a887b0efc58ba2b2d4b59b3ab3aeed27d8eab310cc203a3137f9555bbc7fd1bf2cd8be91e0c45f4332bfc1c7619b9a08bb6e116e16d65d64
@@ -66,8 +66,9 @@ class Permalink
66
66
 
67
67
  # Scope method for finding Permalinks for given value.
68
68
  # The value will be sanitized.
69
- def for_value(value)
70
- where(value: sanitize(value))
69
+ def for_value(value, sanitize = true)
70
+ value = sanitize(value) if sanitize
71
+ where(value: /^#{value}(-\d+)?$/)
71
72
  end
72
73
 
73
74
  def for_scope(scope)
@@ -138,7 +139,7 @@ class Permalink
138
139
  @existing ||= {}
139
140
  @existing[string] ||= Permalink
140
141
  .for_scope(scope)
141
- .where(value: /^#{string}(-\d+)?$/)
142
+ .for_value(string, false)
142
143
  .excludes(:_id => id)
143
144
  .to_a
144
145
  end
@@ -1,5 +1,5 @@
1
1
  module Vidibus
2
2
  module Permalink
3
- VERSION = '1.1.2'
3
+ VERSION = '1.1.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vidibus-permalink
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andre Pankratz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-28 00:00:00.000000000 Z
11
+ date: 2019-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport