can_has_validations 1.8.1 → 1.9.0

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
  SHA256:
3
- metadata.gz: b019c7cb6040ee0139aaaeb3cac5e115cc144cf0b4fb8eef8a6182772704eeb3
4
- data.tar.gz: 7b9cf22f18f2d29092f71c4eacbb26fafb3ea0bf667ae8cc4d203b80c84b9eff
3
+ metadata.gz: 8dcfe4b967c4b3e86b61189140e744bfac77d8dcad89d58eb2109a38edfa11b2
4
+ data.tar.gz: 4508998186812818da3917f68dd53ee63f865664e40f4b6132058f98dfcc9db8
5
5
  SHA512:
6
- metadata.gz: 3604c217ef68acdccc4db9e87309522223722a00f1ab74b6cffb03a67e75450d629168a1f32afcaaf0833d0761e9b9d98cffc23ac65a0473c978d2263381d7d8
7
- data.tar.gz: 1458eb8d69395bf07d745a8b84308aed359f801fdf103577c789a99d4440667a65c8f655f5f21cede6b6c6f83a5dc450bcd9eccb45d7eb30c54ee393326ebdd7
6
+ metadata.gz: b17012db725878e4c58b5f8a89873383495db9bdbe8cdfcae2ada270392c3ba86cff232b2b79a01ae665b5424bbe5013d3a7f2c12fa77fe391e389add99352e7
7
+ data.tar.gz: 40d25e2f3ddd9f24fa8465fadc90595e8013dcd0af003bd4ccd84d6626fe1fbbf47d1ae0a22fcfd9fa1b6af820e4c809835dbd5d47b913107d20f1c48918a790
@@ -1,4 +1,4 @@
1
- Copyright 2012-2023 thomas morgan
1
+ Copyright 2012-2024 thomas morgan
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -72,15 +72,13 @@ module ActiveModel::Validations
72
72
  end
73
73
 
74
74
  def resolve_array(record, val)
75
- res = if val.respond_to?(:call)
75
+ if val.respond_to?(:call)
76
76
  val.call(record)
77
77
  elsif val.is_a?(Symbol)
78
78
  record.send(val)
79
79
  else
80
80
  val
81
81
  end
82
- # raise "#{val.inspect} did not resolve to an Array of IPAddr" unless res.is_a?(Array) && res.all?{|r| r.is_a?(IPAddr)}
83
- # res
84
82
  end
85
83
 
86
84
  end
@@ -18,7 +18,7 @@ module ActiveModel::Validations
18
18
  next unless value && greater
19
19
  unless value < greater
20
20
  attr2 = attr_name.respond_to?(:call) ? 'it is' : record.class.human_attribute_name(attr_name)
21
- record.errors.add(attribute, :before, **options.except(:before).merge!(attribute2: attr2, value: value))
21
+ record.errors.add(attribute, :before, value:, attribute2: attr2, before_value: greater, **options.except(:before))
22
22
  end
23
23
  end
24
24
  end
@@ -33,7 +33,7 @@ module ActiveModel::Validations
33
33
  next unless value && lesser
34
34
  unless value > lesser
35
35
  attr2 = attr_name.respond_to?(:call) ? 'it is' : record.class.human_attribute_name(attr_name)
36
- record.errors.add(attribute, :after, **options.except(:after).merge!(attribute2: attr2, value: value))
36
+ record.errors.add(attribute, :after, value:, attribute2: attr2, after_value: lesser, **options.except(:after))
37
37
  end
38
38
  end
39
39
  end
@@ -1,3 +1,3 @@
1
1
  module CanHasValidations
2
- VERSION = '1.8.1'
2
+ VERSION = '1.9.0'
3
3
  end
Binary file
@@ -11,5 +11,55 @@ CanHasValidationsTest: test_truth
11
11
  TRANSACTION (0.0ms) begin transaction
12
12
  ---------------------------------
13
13
  CanHasValidationsTest: test_truth
14
+ ---------------------------------
15
+ TRANSACTION (0.0ms) rollback transaction
16
+  (0.3ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)
17
+  (0.1ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL)
18
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
19
+ TRANSACTION (0.0ms) begin transaction
20
+ ---------------------------------
21
+ CanHasValidationsTest: test_truth
22
+ ---------------------------------
23
+ TRANSACTION (0.0ms) rollback transaction
24
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
25
+ TRANSACTION (0.0ms) begin transaction
26
+ ---------------------------------
27
+ CanHasValidationsTest: test_truth
28
+ ---------------------------------
29
+ TRANSACTION (0.0ms) rollback transaction
30
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
31
+ TRANSACTION (0.0ms) begin transaction
32
+ ---------------------------------
33
+ CanHasValidationsTest: test_truth
34
+ ---------------------------------
35
+ TRANSACTION (0.0ms) rollback transaction
36
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
37
+ TRANSACTION (0.0ms) begin transaction
38
+ ---------------------------------
39
+ CanHasValidationsTest: test_truth
40
+ ---------------------------------
41
+ TRANSACTION (0.0ms) rollback transaction
42
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
43
+ TRANSACTION (0.0ms) begin transaction
44
+ ---------------------------------
45
+ CanHasValidationsTest: test_truth
46
+ ---------------------------------
47
+ TRANSACTION (0.0ms) rollback transaction
48
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
49
+ TRANSACTION (0.0ms) begin transaction
50
+ ---------------------------------
51
+ CanHasValidationsTest: test_truth
52
+ ---------------------------------
53
+ TRANSACTION (0.0ms) rollback transaction
54
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
55
+ TRANSACTION (0.0ms) begin transaction
56
+ ---------------------------------
57
+ CanHasValidationsTest: test_truth
58
+ ---------------------------------
59
+ TRANSACTION (0.0ms) rollback transaction
60
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
61
+ TRANSACTION (0.0ms) begin transaction
62
+ ---------------------------------
63
+ CanHasValidationsTest: test_truth
14
64
  ---------------------------------
15
65
  TRANSACTION (0.0ms) rollback transaction
@@ -0,0 +1 @@
1
+ 61a3c8e99a7b6cc0bb0f95a6ae452d5b035a9b9d0ff2f176f3a0726e9b80c930654d3c14096e5f0db05bcf7cc079f0a68a94c2ff61e27a40d6ed12d1544c112f
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: can_has_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thomas morgan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-12 00:00:00.000000000 Z
11
+ date: 2024-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -48,16 +48,16 @@ dependencies:
48
48
  name: sqlite3
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ">="
51
+ - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0'
53
+ version: '1.4'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ">="
58
+ - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0'
60
+ version: '1.4'
61
61
  description: 'Assorted Rails 5.x-7.x validators: Array, Email, Existence, Grandparent,
62
62
  Hash keys, Hash values, Hostname, IP address, Ordering, URL, Write Once'
63
63
  email:
@@ -66,7 +66,7 @@ executables: []
66
66
  extensions: []
67
67
  extra_rdoc_files: []
68
68
  files:
69
- - MIT-LICENSE
69
+ - LICENSE.txt
70
70
  - README.md
71
71
  - Rakefile
72
72
  - lib/can_has_validations.rb
@@ -126,6 +126,7 @@ files:
126
126
  - test/dummy/public/favicon.ico
127
127
  - test/dummy/script/rails
128
128
  - test/dummy/tmp/development_secret.txt
129
+ - test/dummy/tmp/local_secret.txt
129
130
  - test/test_helper.rb
130
131
  homepage: https://github.com/zarqman/can_has_validations
131
132
  licenses:
@@ -146,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
147
  - !ruby/object:Gem::Version
147
148
  version: '0'
148
149
  requirements: []
149
- rubygems_version: 3.4.10
150
+ rubygems_version: 3.5.11
150
151
  signing_key:
151
152
  specification_version: 4
152
153
  summary: Assorted Rails 5.x-7.x validators
@@ -191,4 +192,5 @@ test_files:
191
192
  - test/dummy/public/favicon.ico
192
193
  - test/dummy/script/rails
193
194
  - test/dummy/tmp/development_secret.txt
195
+ - test/dummy/tmp/local_secret.txt
194
196
  - test/test_helper.rb