activemodel 5.1.0.rc1 → 5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c49039ac3278df2457a9a5b854001bd2801ba3ca
4
- data.tar.gz: 04527bdc4133fa4d524047ade1afef8ab68c83fc
3
+ metadata.gz: d126b406fb4153a11149d0ba378fa06703a6ee9d
4
+ data.tar.gz: 468c386fe0b26099ff0ef48a48ec22363d1d62db
5
5
  SHA512:
6
- metadata.gz: 1c07749aa74321242d26822f59f0019b8a7c3a5b5f328b1a4764ac2f983f91cb908ef4f3762af5cf45d98a0bf13e91949272ac15567075d88bc3b7270b850902
7
- data.tar.gz: 2f2cf9cab4be69f903d35131a956db57bd49ca6d020a56a43118aacf87c7a758ca907a22782844e37a1edb60453e233d2f241292e01b3f251ff8644d5fd41f12
6
+ metadata.gz: 677a1fe0c1b1b41264662a79b308727f1632aa1796e176e24e482ef1271c1da8700a4f9ce1d6d6fe8912151b8ce668bd4411df0fbc1f749469098fd9b581490d
7
+ data.tar.gz: 3fb2c7da9bb1fdb8f522128e6c37110e06141a0db99f327ff64cb632b0c5684c22130cfd2d1f936a6b7e47daa94df1d55870ff94380ac818e183ead10bf43001
@@ -1,3 +1,17 @@
1
+ ## Rails 5.1.0.rc2 (April 20, 2017) ##
2
+
3
+ * The original string assigned to a model attribute is no longer incorrectly
4
+ frozen.
5
+
6
+ Fixes #24185, #28718.
7
+
8
+ *Matthew Draper*
9
+
10
+ * Avoid converting integer as a string into float.
11
+
12
+ *namusyaka*
13
+
14
+
1
15
  ## Rails 5.1.0.rc1 (March 20, 2017) ##
2
16
 
3
17
  * No changes.
@@ -8,7 +8,7 @@ module ActiveModel
8
8
  MAJOR = 5
9
9
  MINOR = 1
10
10
  TINY = 0
11
- PRE = "rc1"
11
+ PRE = "rc2"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -12,7 +12,12 @@ module ActiveModel
12
12
  private
13
13
 
14
14
  def cast_value(value)
15
- ::String.new(super)
15
+ case value
16
+ when ::String then ::String.new(value)
17
+ when true then "t".freeze
18
+ when false then "f".freeze
19
+ else value.to_s
20
+ end
16
21
  end
17
22
  end
18
23
  end
@@ -70,6 +70,7 @@ module ActiveModel
70
70
  end
71
71
 
72
72
  def parse_raw_value_as_a_number(raw_value)
73
+ return raw_value.to_i if is_integer?(raw_value)
73
74
  Kernel.Float(raw_value) if raw_value !~ /\A0[xX]/
74
75
  end
75
76
 
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.1.0.rc1
4
+ version: 5.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: 2017-03-20 00:00:00.000000000 Z
11
+ date: 2017-04-21 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.1.0.rc1
19
+ version: 5.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: 5.1.0.rc1
26
+ version: 5.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.