stronger_parameters 2.10.1 → 2.11.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7bf5a04a553cb2a9a0db16f88d9d6b387d8f607150d998338afd18b50b0d3ac
|
4
|
+
data.tar.gz: fa3ec817f7042d045d66761db3280b49b9b05fe33e094f1930ca0a80699d3286
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1368dd9057bdaac8cd2f89dc174c513f84bb56ddc49fc421f1c840861cffe7a1cc0e8eec4bc939f06cc681bedbc553c6cd3d8132a19d4b2343f21b648d96fc58
|
7
|
+
data.tar.gz: 0ced957cd68f9843d098d4bf4350a8466766aba1fb30a3101ff114591087f490ac8b429a01a6767fea677a80f6d0e2367f9ea3f62c3c73d633a7e2874646b63e
|
@@ -3,6 +3,7 @@ require 'stronger_parameters/constraint'
|
|
3
3
|
require 'stronger_parameters/constraints/string_constraint'
|
4
4
|
require 'stronger_parameters/constraints/float_constraint'
|
5
5
|
require 'stronger_parameters/constraints/date_time_constraint'
|
6
|
+
require 'stronger_parameters/constraints/date_time_iso8601_constraint'
|
6
7
|
require 'stronger_parameters/constraints/regexp_constraint'
|
7
8
|
require 'stronger_parameters/constraints/integer_constraint'
|
8
9
|
require 'stronger_parameters/constraints/nil_constraint'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# rubocop:disable Style/DateTime
|
3
|
+
require 'stronger_parameters/constraint'
|
4
|
+
|
5
|
+
module StrongerParameters
|
6
|
+
class DateTimeIso8601Constraint < Constraint
|
7
|
+
def value(v)
|
8
|
+
DateTime.iso8601 v
|
9
|
+
rescue ArgumentError, TypeError
|
10
|
+
StrongerParameters::InvalidValue.new(v, "must be an iso8601 date")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
# rubocop:enable Style/DateTime
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stronger_parameters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mick Staugaard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -199,6 +199,7 @@ files:
|
|
199
199
|
- lib/stronger_parameters/constraints/boolean_constraint.rb
|
200
200
|
- lib/stronger_parameters/constraints/comparison_constraints.rb
|
201
201
|
- lib/stronger_parameters/constraints/date_time_constraint.rb
|
202
|
+
- lib/stronger_parameters/constraints/date_time_iso8601_constraint.rb
|
202
203
|
- lib/stronger_parameters/constraints/decimal_constraint.rb
|
203
204
|
- lib/stronger_parameters/constraints/enumeration_constraint.rb
|
204
205
|
- lib/stronger_parameters/constraints/file_constraint.rb
|