mv-core 2.2.3 → 2.2.4
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 +4 -4
- data/README.md +4 -0
- data/lib/mv/core/presenter/validation/base.rb +6 -5
- 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: da6a7fa2769528ae88761953e67477adf81ea121
|
|
4
|
+
data.tar.gz: de4fbd347817757c7b89b80d82f332bbc3a7b40d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 91e68192f6cd1c01c98534dfc5410d521123cf8e00e01aa86cba47460a96a04932d696be09b1fb800ac371b84b20d2a4af341f0f26df75cd1aa02c9e8869e47d
|
|
7
|
+
data.tar.gz: 0ff2511ee62f1ac595b9e91f2d67c2c78a1b7c31c9c02df571bb5dfa0273981d1c518d9cb96c20b410febf2d4a9740b57af1b52b48ef2525b4e41eea7cc6917f
|
data/README.md
CHANGED
|
@@ -362,6 +362,10 @@ So - see detailed info here:
|
|
|
362
362
|
|
|
363
363
|
* Suppress exception while running db:schema:load
|
|
364
364
|
|
|
365
|
+
**(2.2.4)** (12 Sep, 2016)
|
|
366
|
+
|
|
367
|
+
* Escape single quotes in the custom validation statement body
|
|
368
|
+
|
|
365
369
|
## Contributing
|
|
366
370
|
|
|
367
371
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
|
@@ -35,7 +35,7 @@ module Mv
|
|
|
35
35
|
return date_to_str(value) if value.is_a?(Date)
|
|
36
36
|
return range_to_str(value) if value.is_a?(Range)
|
|
37
37
|
return array_to_str(value) if value.is_a?(Array)
|
|
38
|
-
return "'#{value}'" if value.is_a?(String)
|
|
38
|
+
return "'#{escaped_string(value)}'" if value.is_a?(String)
|
|
39
39
|
return "/#{value.source}/" if value.is_a?(Regexp)
|
|
40
40
|
value.to_s
|
|
41
41
|
end
|
|
@@ -46,13 +46,14 @@ module Mv
|
|
|
46
46
|
|
|
47
47
|
def range_to_str value
|
|
48
48
|
[
|
|
49
|
-
value_to_str(value.first),
|
|
50
|
-
value.exclude_end? ? '...' : '..',
|
|
49
|
+
value_to_str(value.first),
|
|
50
|
+
value.exclude_end? ? '...' : '..',
|
|
51
51
|
value_to_str(value.last)
|
|
52
52
|
].join
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
-
def
|
|
55
|
+
def escaped_string value
|
|
56
|
+
value.gsub(/'/, %q(\\\'))
|
|
56
57
|
end
|
|
57
58
|
|
|
58
59
|
def time_to_str value
|
|
@@ -70,4 +71,4 @@ module Mv
|
|
|
70
71
|
end
|
|
71
72
|
end
|
|
72
73
|
end
|
|
73
|
-
end
|
|
74
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mv-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.2.
|
|
4
|
+
version: 2.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Valeriy Prokopchuk
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-09-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: railties
|