activemodel 5.0.0.rc2 → 5.0.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
  SHA1:
3
- metadata.gz: 3f7ad7a43ab3ab58ba5f7416d2ccf4f703022c69
4
- data.tar.gz: 2c34cdd86def65c713490bae07845a11f042fd55
3
+ metadata.gz: f48403097ada0a83a60381bb5fadd9dd3db8d18d
4
+ data.tar.gz: 09c5350eff58df91adbe0817796cdcf721896687
5
5
  SHA512:
6
- metadata.gz: 86c1a3cd564baa3947317fda7e795c0552fba747cabf4d3b49c4a6429d49dca2d8cc923b54eda49c540d79ca44a7e09bcf81054cc94d5b1b63998e8b98355c96
7
- data.tar.gz: 192a19c563abce9f7a9dfcb9c169427bd4fe34be360d6fde5a6f14ea3efca44c85e95b1d177f60975296649b440eb7affd9c7a8e7d14d0b5040685ac7f2000e8
6
+ metadata.gz: 392b61a079d2fa9cbd7f95b7170cfc4fcc2150eccd12bbb95e32c75e103ca875d02d638620455deafb97c8c5edd2a0e34e546d1a628387c2555bd35c500c09c0
7
+ data.tar.gz: ac45013f52613dabfddb2326bc657539f4c5f4df610fc7a723a5783e23875846acc6c086c7e379c55627aef4a563ef7a4fd60985a0a58bff5dd8a7ea1f94e10d
@@ -1,34 +1,15 @@
1
- ## Rails 5.0.0.rc2 (June 22, 2016) ##
1
+ ## Rails 5.0.0 (June 30, 2016) ##
2
2
 
3
3
  * Ensure that instances of `ActiveModel::Errors` can be marshalled.
4
4
  Fixes #25165.
5
5
 
6
6
  *Sean Griffin*
7
7
 
8
- ## Rails 5.0.0.rc1 (May 06, 2016) ##
9
-
10
- * No changes.
11
-
12
-
13
- ## Rails 5.0.0.beta4 (April 27, 2016) ##
14
-
15
8
  * Allow passing record being validated to the message proc to generate
16
9
  customized error messages for that object using I18n helper.
17
10
 
18
11
  *Prathamesh Sonpatki*
19
12
 
20
- ## Rails 5.0.0.beta3 (February 24, 2016) ##
21
-
22
- * No changes.
23
-
24
-
25
- ## Rails 5.0.0.beta2 (February 01, 2016) ##
26
-
27
- * No changes.
28
-
29
-
30
- ## Rails 5.0.0.beta1 (December 18, 2015) ##
31
-
32
13
  * Validate multiple contexts on `valid?` and `invalid?` at once.
33
14
 
34
15
  Example:
@@ -147,9 +147,9 @@ module ActiveModel
147
147
 
148
148
  # Delete messages for +key+. Returns the deleted messages.
149
149
  #
150
- # person.errors[:name] # => ["cannot be nil"]
150
+ # person.errors[:name] # => ["cannot be nil"]
151
151
  # person.errors.delete(:name) # => ["cannot be nil"]
152
- # person.errors[:name] # => []
152
+ # person.errors[:name] # => []
153
153
  def delete(key)
154
154
  details.delete(key)
155
155
  messages.delete(key)
@@ -385,7 +385,18 @@ module ActiveModel
385
385
  # present, +false+ otherwise. +message+ is treated the same as for +add+.
386
386
  #
387
387
  # person.errors.add :name, :blank
388
- # person.errors.added? :name, :blank # => true
388
+ # person.errors.added? :name, :blank # => true
389
+ # person.errors.added? :name, "can't be blank" # => true
390
+ #
391
+ # If the error message requires an option, then it returns +true+ with
392
+ # the correct option, or +false+ with an incorrect or missing option.
393
+ #
394
+ # person.errors.add :name, :too_long, { count: 25 }
395
+ # person.errors.added? :name, :too_long, count: 25 # => true
396
+ # person.errors.added? :name, "is too long (maximum is 25 characters)" # => true
397
+ # person.errors.added? :name, :too_long, count: 24 # => false
398
+ # person.errors.added? :name, :too_long # => false
399
+ # person.errors.added? :name, "is too long" # => false
389
400
  def added?(attribute, message = :invalid, options = {})
390
401
  message = message.call if message.respond_to?(:call)
391
402
  message = normalize_message(attribute, message, options)
@@ -8,7 +8,7 @@ module ActiveModel
8
8
  MAJOR = 5
9
9
  MINOR = 0
10
10
  TINY = 0
11
- PRE = "rc2"
11
+ PRE = nil
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  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: 5.0.0.rc2
4
+ version: 5.0.0
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: 2016-06-22 00:00:00.000000000 Z
11
+ date: 2016-06-30 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: 5.0.0.rc2
19
+ version: 5.0.0
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: 5.0.0.rc2
26
+ version: 5.0.0
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.
@@ -108,9 +108,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
108
  version: 2.2.2
109
109
  required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - ">"
111
+ - - ">="
112
112
  - !ruby/object:Gem::Version
113
- version: 1.3.1
113
+ version: '0'
114
114
  requirements: []
115
115
  rubyforge_project:
116
116
  rubygems_version: 2.6.4