vidibus-permalink 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/permalink.rb +4 -3
- data/lib/vidibus/permalink/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 515aa963b43b3d2cdf4576dfe00e9e8ddee3b819
|
4
|
+
data.tar.gz: 5d7edb952308577f1d5b0a2893df325bf26d08c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eaf165cd78288a6cb4ab0933b4d1c82b6a13954637b0ebb5bbbcf1549187a9b80b370c15e3b56afea9057ea290066bb0018378c489ce584b43a97537d51a420b
|
7
|
+
data.tar.gz: 426bb22b0fa89969a887b0efc58ba2b2d4b59b3ab3aeed27d8eab310cc203a3137f9555bbc7fd1bf2cd8be91e0c45f4332bfc1c7619b9a08bb6e116e16d65d64
|
data/app/models/permalink.rb
CHANGED
@@ -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
|
-
|
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
|
-
.
|
142
|
+
.for_value(string, false)
|
142
143
|
.excludes(:_id => id)
|
143
144
|
.to_a
|
144
145
|
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.
|
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
|
11
|
+
date: 2019-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|