activemodel 5.0.1 → 5.0.2.rc1

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: dbc02006f6dc846c6c0de3a290dd1c5f6fc42bc5
4
- data.tar.gz: 87b3378d386613a43b19249cccade71ae7c5f040
3
+ metadata.gz: e6478aed31db67327c7b582b38a99a8d8012d21e
4
+ data.tar.gz: ce43542457545cf2cdb4375b42760d0ab28c9b93
5
5
  SHA512:
6
- metadata.gz: c47a5dd80ce211c3d699d646f1644ac0b45aec8789a46ed112fabd60799989cc9bd48853a9d911b070b134612b4348625ecb3dbe1f111c8622de6ee213805bc2
7
- data.tar.gz: 90dd2e63d580adfa903f0e8fcc3a960109cdb25eed2d486ba73a682a373723c82094fff5ed878276241289e3972de649e0b1a6847df6372aa3763514d229c0d0
6
+ metadata.gz: 83c6218a1d654fc8456a1ded2cdf987edd61e0e93c2f9a07515672c3cd4f100fc160e15bbd3222398f4b676508250b3701320a60aa4defda84b618be3085c82b
7
+ data.tar.gz: 77d1f87f5b3a217061246561ffad2b46f8a107b790d613473c2fd4a947e70100661809719bea17d9cf8dd4f5b2f1eff159c90490575933e06b37ff63ec8384c5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## Rails 5.0.2.rc1 (February 24, 2017) ##
2
+
3
+ * No changes.
4
+
5
+
1
6
  ## Rails 5.0.1 (December 21, 2016) ##
2
7
 
3
8
  * No changes.
@@ -504,16 +504,23 @@ module ActiveModel
504
504
  I18n.translate(key, options)
505
505
  end
506
506
 
507
- def marshal_dump
507
+ def marshal_dump # :nodoc:
508
508
  [@base, without_default_proc(@messages), without_default_proc(@details)]
509
509
  end
510
510
 
511
- def marshal_load(array)
511
+ def marshal_load(array) # :nodoc:
512
512
  @base, @messages, @details = array
513
513
  apply_default_array(@messages)
514
514
  apply_default_array(@details)
515
515
  end
516
516
 
517
+ def init_with(coder) # :nodoc:
518
+ coder.map.each { |k, v| instance_variable_set(:"@#{k}", v) }
519
+ @details ||= {}
520
+ apply_default_array(@messages)
521
+ apply_default_array(@details)
522
+ end
523
+
517
524
  private
518
525
  def normalize_message(attribute, message, options)
519
526
  case message
@@ -7,8 +7,8 @@ module ActiveModel
7
7
  module VERSION
8
8
  MAJOR = 5
9
9
  MINOR = 0
10
- TINY = 1
11
- PRE = nil
10
+ TINY = 2
11
+ PRE = "rc1"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -19,8 +19,14 @@ module ActiveModel
19
19
  casted_value = case value
20
20
  when ::Float
21
21
  convert_float_to_big_decimal(value)
22
- when ::Numeric, ::String
22
+ when ::Numeric
23
23
  BigDecimal(value, precision.to_i)
24
+ when ::String
25
+ begin
26
+ value.to_d
27
+ rescue ArgumentError
28
+ BigDecimal(0)
29
+ end
24
30
  else
25
31
  if value.respond_to?(:to_d)
26
32
  value.to_d
@@ -142,8 +142,8 @@ module ActiveModel
142
142
  end
143
143
 
144
144
  # Performs validation on the supplied record. By default this will call
145
- # +validates_each+ to determine validity therefore subclasses should
146
- # override +validates_each+ with validation logic.
145
+ # +validate_each+ to determine validity therefore subclasses should
146
+ # override +validate_each+ with validation logic.
147
147
  def validate(record)
148
148
  attributes.each do |attribute|
149
149
  value = record.read_attribute_for_validation(attribute)
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.1
4
+ version: 5.0.2.rc1
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-12-21 00:00:00.000000000 Z
11
+ date: 2017-02-25 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.1
19
+ version: 5.0.2.rc1
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.1
26
+ version: 5.0.2.rc1
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,14 +108,13 @@ 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: '0'
113
+ version: 1.3.1
114
114
  requirements: []
115
115
  rubyforge_project:
116
- rubygems_version: 2.5.2
116
+ rubygems_version: 2.6.10
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: A toolkit for building modeling frameworks (part of Rails).
120
120
  test_files: []
121
- has_rdoc: