activemodel 7.1.0.beta1 → 7.1.0.rc2
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/CHANGELOG.md +17 -0
- data/lib/active_model/errors.rb +6 -6
- data/lib/active_model/gem_version.rb +1 -1
- data/lib/active_model/locale/en.yml +3 -3
- data/lib/active_model/secure_password.rb +1 -1
- data/lib/active_model/validations/confirmation.rb +1 -1
- data/lib/active_model/validations/presence.rb +1 -1
- data/lib/active_model/validations/validates.rb +1 -1
- data/lib/active_model/validations.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14ae733bb8a7ad121abc50ca0000c90259f2e809a17cf7f70e96bb335bf6cbb0
|
4
|
+
data.tar.gz: 4d87916686208e1a61eee0903b00b3ef06ed6f03d8738e9254b94da5009a4629
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 799a6317d2c72099882e5ca405d313ab96fd83e98e80034ec93240ccf060516c40cdfafd7982f48bc4a060a79b8b95bef0030935d030ce039124f35bce688cd7
|
7
|
+
data.tar.gz: 3c3ff1def6ecb3eb57fe321f00af15bf071719cc35dc0897750e08294d3b16e82c60f544ae7fc47584678af0018c0bd806e4589bedaf962f40dbc0cf9b4a1bb0
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## Rails 7.1.0.rc2 (October 01, 2023) ##
|
2
|
+
|
3
|
+
* No changes.
|
4
|
+
|
5
|
+
|
6
|
+
## Rails 7.1.0.rc1 (September 27, 2023) ##
|
7
|
+
|
8
|
+
* Remove change in the typography of user facing error messages.
|
9
|
+
For example, “can’t be blank” is again “can't be blank”.
|
10
|
+
|
11
|
+
*Rafael Mendonça França*
|
12
|
+
|
13
|
+
|
1
14
|
## Rails 7.1.0.beta1 (September 13, 2023) ##
|
2
15
|
|
3
16
|
* Support composite identifiers in `to_key`
|
@@ -176,6 +189,10 @@
|
|
176
189
|
validates_inclusion_of :birth_date, in: -> { (..Date.today) }
|
177
190
|
```
|
178
191
|
|
192
|
+
```ruby
|
193
|
+
validates_exclusion_of :birth_date, in: -> { (..Date.today) }
|
194
|
+
```
|
195
|
+
|
179
196
|
*Bo Jeanes*
|
180
197
|
|
181
198
|
* Make validators accept lambdas without record argument
|
data/lib/active_model/errors.rb
CHANGED
@@ -284,7 +284,7 @@ module ActiveModel
|
|
284
284
|
#
|
285
285
|
# person.errors.add(:name, :blank)
|
286
286
|
# person.errors.messages
|
287
|
-
# # => {:name=>["can
|
287
|
+
# # => {:name=>["can't be blank"]}
|
288
288
|
#
|
289
289
|
# person.errors.add(:name, :too_long, count: 25)
|
290
290
|
# person.errors.messages
|
@@ -332,7 +332,7 @@ module ActiveModel
|
|
332
332
|
#
|
333
333
|
# person.errors.add :name, :blank
|
334
334
|
# person.errors.added? :name, :blank # => true
|
335
|
-
# person.errors.added? :name, "can
|
335
|
+
# person.errors.added? :name, "can't be blank" # => true
|
336
336
|
#
|
337
337
|
# If the error requires options, then it returns +true+ with
|
338
338
|
# the correct options, or +false+ with incorrect or missing options.
|
@@ -385,7 +385,7 @@ module ActiveModel
|
|
385
385
|
#
|
386
386
|
# person = Person.create(address: '123 First St.')
|
387
387
|
# person.errors.full_messages
|
388
|
-
# # => ["Name is too short (minimum is 5 characters)", "Name can
|
388
|
+
# # => ["Name is too short (minimum is 5 characters)", "Name can't be blank", "Email can't be blank"]
|
389
389
|
def full_messages
|
390
390
|
@errors.map(&:full_message)
|
391
391
|
end
|
@@ -400,7 +400,7 @@ module ActiveModel
|
|
400
400
|
#
|
401
401
|
# person = Person.create()
|
402
402
|
# person.errors.full_messages_for(:name)
|
403
|
-
# # => ["Name is too short (minimum is 5 characters)", "Name can
|
403
|
+
# # => ["Name is too short (minimum is 5 characters)", "Name can't be blank"]
|
404
404
|
def full_messages_for(attribute)
|
405
405
|
where(attribute).map(&:full_message).freeze
|
406
406
|
end
|
@@ -414,7 +414,7 @@ module ActiveModel
|
|
414
414
|
#
|
415
415
|
# person = Person.create()
|
416
416
|
# person.errors.messages_for(:name)
|
417
|
-
# # => ["is too short (minimum is 5 characters)", "can
|
417
|
+
# # => ["is too short (minimum is 5 characters)", "can't be blank"]
|
418
418
|
def messages_for(attribute)
|
419
419
|
where(attribute).map(&:message)
|
420
420
|
end
|
@@ -487,7 +487,7 @@ module ActiveModel
|
|
487
487
|
# person = Person.new
|
488
488
|
# person.name = nil
|
489
489
|
# person.valid?
|
490
|
-
# # => ActiveModel::StrictValidationFailed: Name can
|
490
|
+
# # => ActiveModel::StrictValidationFailed: Name can't be blank
|
491
491
|
class StrictValidationFailed < StandardError
|
492
492
|
end
|
493
493
|
|
@@ -10,10 +10,10 @@ en:
|
|
10
10
|
inclusion: "is not included in the list"
|
11
11
|
exclusion: "is reserved"
|
12
12
|
invalid: "is invalid"
|
13
|
-
confirmation: "doesn
|
13
|
+
confirmation: "doesn't match %{attribute}"
|
14
14
|
accepted: "must be accepted"
|
15
|
-
empty: "can
|
16
|
-
blank: "can
|
15
|
+
empty: "can't be empty"
|
16
|
+
blank: "can't be blank"
|
17
17
|
present: "must be blank"
|
18
18
|
too_long:
|
19
19
|
one: "is too long (maximum is 1 character)"
|
@@ -57,7 +57,7 @@ module ActiveModel
|
|
57
57
|
#
|
58
58
|
# user.save # => false, password required
|
59
59
|
# user.password = "vr00m"
|
60
|
-
# user.save # => false, confirmation doesn
|
60
|
+
# user.save # => false, confirmation doesn't match
|
61
61
|
# user.password_confirmation = "vr00m"
|
62
62
|
# user.save # => true
|
63
63
|
#
|
@@ -64,7 +64,7 @@ module ActiveModel
|
|
64
64
|
# validates_presence_of :password_confirmation, if: :password_changed?
|
65
65
|
#
|
66
66
|
# Configuration options:
|
67
|
-
# * <tt>:message</tt> - A custom error message (default is: "doesn
|
67
|
+
# * <tt>:message</tt> - A custom error message (default is: "doesn't match
|
68
68
|
# <tt>%{translated_attribute_name}</tt>").
|
69
69
|
# * <tt>:case_sensitive</tt> - Looks for an exact match. Ignored by
|
70
70
|
# non-text columns (+true+ by default).
|
@@ -26,7 +26,7 @@ module ActiveModel
|
|
26
26
|
# <tt>false.blank? # => true</tt>.
|
27
27
|
#
|
28
28
|
# Configuration options:
|
29
|
-
# * <tt>:message</tt> - A custom error message (default is: "can
|
29
|
+
# * <tt>:message</tt> - A custom error message (default is: "can't be blank").
|
30
30
|
#
|
31
31
|
# There is also a list of default options supported by every validator:
|
32
32
|
# +:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+.
|
@@ -144,7 +144,7 @@ module ActiveModel
|
|
144
144
|
# person = Person.new
|
145
145
|
# person.name = ''
|
146
146
|
# person.valid?
|
147
|
-
# # => ActiveModel::StrictValidationFailed: Name can
|
147
|
+
# # => ActiveModel::StrictValidationFailed: Name can't be blank
|
148
148
|
def validates!(*attributes)
|
149
149
|
options = attributes.extract_options!
|
150
150
|
options[:strict] = true
|
@@ -326,7 +326,7 @@ module ActiveModel
|
|
326
326
|
#
|
327
327
|
# person = Person.new
|
328
328
|
# person.valid? # => false
|
329
|
-
# person.errors # => #<ActiveModel::Errors:0x007fe603816640 @messages={name:["can
|
329
|
+
# person.errors # => #<ActiveModel::Errors:0x007fe603816640 @messages={name:["can't be blank"]}>
|
330
330
|
def errors
|
331
331
|
@errors ||= Errors.new(self)
|
332
332
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activemodel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.1.0.
|
4
|
+
version: 7.1.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 7.1.0.
|
19
|
+
version: 7.1.0.rc2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 7.1.0.
|
26
|
+
version: 7.1.0.rc2
|
27
27
|
description: A toolkit for building modeling frameworks like Active Record. Rich support
|
28
28
|
for attributes, callbacks, validations, serialization, internationalization, and
|
29
29
|
testing.
|
@@ -112,10 +112,10 @@ licenses:
|
|
112
112
|
- MIT
|
113
113
|
metadata:
|
114
114
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
115
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.1.0.
|
116
|
-
documentation_uri: https://api.rubyonrails.org/v7.1.0.
|
115
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.1.0.rc2/activemodel/CHANGELOG.md
|
116
|
+
documentation_uri: https://api.rubyonrails.org/v7.1.0.rc2/
|
117
117
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
118
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.1.0.
|
118
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.1.0.rc2/activemodel
|
119
119
|
rubygems_mfa_required: 'true'
|
120
120
|
post_install_message:
|
121
121
|
rdoc_options: []
|