activemodel 5.0.0.racecar1 → 5.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd003223e187a32f58824d78ece0a67e396fe45e
4
- data.tar.gz: 7de681ddb7575f456d11ede95bedd5f40e35652c
3
+ metadata.gz: 3f7ad7a43ab3ab58ba5f7416d2ccf4f703022c69
4
+ data.tar.gz: 2c34cdd86def65c713490bae07845a11f042fd55
5
5
  SHA512:
6
- metadata.gz: 4ce0eb2ac90f1feeb25eeb7b577f036f9cd1fb12124c83a17a0b0050b93048a8a301336bd8c94fa51452d48756379923256c609383d585cedd73fff8d8925bf8
7
- data.tar.gz: 166e02c1be2aac431b3b77c5f0fbd803408e5bb6e927f1d61bd40cf57b94644b2e21aaf753f7718357b350e6d3d5771b6c76000bec06c01af1db702552b04453
6
+ metadata.gz: 86c1a3cd564baa3947317fda7e795c0552fba747cabf4d3b49c4a6429d49dca2d8cc923b54eda49c540d79ca44a7e09bcf81054cc94d5b1b63998e8b98355c96
7
+ data.tar.gz: 192a19c563abce9f7a9dfcb9c169427bd4fe34be360d6fde5a6f14ea3efca44c85e95b1d177f60975296649b440eb7affd9c7a8e7d14d0b5040685ac7f2000e8
@@ -1,3 +1,10 @@
1
+ ## Rails 5.0.0.rc2 (June 22, 2016) ##
2
+
3
+ * Ensure that instances of `ActiveModel::Errors` can be marshalled.
4
+ Fixes #25165.
5
+
6
+ *Sean Griffin*
7
+
1
8
  ## Rails 5.0.0.rc1 (May 06, 2016) ##
2
9
 
3
10
  * No changes.
@@ -71,8 +71,8 @@ module ActiveModel
71
71
  # end
72
72
  def initialize(base)
73
73
  @base = base
74
- @messages = Hash.new { |messages, attribute| messages[attribute] = [] }
75
- @details = Hash.new { |details, attribute| details[attribute] = [] }
74
+ @messages = apply_default_array({})
75
+ @details = apply_default_array({})
76
76
  end
77
77
 
78
78
  def initialize_dup(other) # :nodoc:
@@ -493,6 +493,16 @@ module ActiveModel
493
493
  I18n.translate(key, options)
494
494
  end
495
495
 
496
+ def marshal_dump
497
+ [@base, without_default_proc(@messages), without_default_proc(@details)]
498
+ end
499
+
500
+ def marshal_load(array)
501
+ @base, @messages, @details = array
502
+ apply_default_array(@messages)
503
+ apply_default_array(@details)
504
+ end
505
+
496
506
  private
497
507
  def normalize_message(attribute, message, options)
498
508
  case message
@@ -506,6 +516,17 @@ module ActiveModel
506
516
  def normalize_detail(message, options)
507
517
  { error: message }.merge(options.except(*CALLBACKS_OPTIONS + MESSAGE_OPTIONS))
508
518
  end
519
+
520
+ def without_default_proc(hash)
521
+ hash.dup.tap do |new_h|
522
+ new_h.default_proc = nil
523
+ end
524
+ end
525
+
526
+ def apply_default_array(hash)
527
+ hash.default_proc = proc { |h, key| h[key] = [] }
528
+ hash
529
+ end
509
530
  end
510
531
 
511
532
  # Raised when a validation cannot be corrected by end users and are considered
@@ -8,7 +8,7 @@ module ActiveModel
8
8
  MAJOR = 5
9
9
  MINOR = 0
10
10
  TINY = 0
11
- PRE = "racecar1"
11
+ PRE = "rc2"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -120,7 +120,7 @@ module ActiveModel
120
120
  # * <tt>:only_integer</tt> - Specifies whether the value has to be an
121
121
  # integer, e.g. an integral value (default is +false+).
122
122
  # * <tt>:allow_nil</tt> - Skip validation if attribute is +nil+ (default is
123
- # +false+). Notice that for fixnum and float columns empty strings are
123
+ # +false+). Notice that for Integer and Float columns empty strings are
124
124
  # converted to +nil+.
125
125
  # * <tt>:greater_than</tt> - Specifies the value must be greater than the
126
126
  # supplied value.
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.racecar1
4
+ version: 5.0.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: 2016-05-06 00:00:00.000000000 Z
11
+ date: 2016-06-22 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.racecar1
19
+ version: 5.0.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: 5.0.0.racecar1
26
+ version: 5.0.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.
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  version: 1.3.1
114
114
  requirements: []
115
115
  rubyforge_project:
116
- rubygems_version: 2.5.1
116
+ rubygems_version: 2.6.4
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: A toolkit for building modeling frameworks (part of Rails).