activemodel 5.0.2 → 5.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd55a3b1eb03b9432f648551088ee1b11f578732
4
- data.tar.gz: 29a7c95ddafce04cda55f4f93f7962e0b91b56b2
3
+ metadata.gz: 2da6af23ed9b706fd8216e7c548297e7692bdb1a
4
+ data.tar.gz: fe2ff2e94c8be6842c048e5ee0a2296c5ec2cffe
5
5
  SHA512:
6
- metadata.gz: '0420191abbee65750f459bd1e9f0900a389d562fd7bb9e12f526f29803611e843b706456ac51c1f4b8470114669af0d35a71a0dbaa78ce210cb49c3a21620811'
7
- data.tar.gz: 11b3f57debd0a1edc23f2358b591934057c3746756988dc9953e618a04c8c93fb3ea0c6ed589e5fcc42758222a5cba5f83d8933273f5ec700228b3920333f9dc
6
+ metadata.gz: ecd3c66ca0a85491aba53dc96ec13ab73f8d38184faa10a84a417b0d9ff2232637642a7c5d0ee3db23e138c6fdeac7e3ff95edeefca368beacb69ef01227c31e
7
+ data.tar.gz: 31c5352e19ceb3182def9fd945048f994a3aae304502ba773c7a2f452c246ec0ca9b7d9ba410fd6e2b4dd80a116566b87cf21c007dddc118a908ebe7693980ba
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ * The original string assigned to a model attribute is no longer incorrectly
2
+ frozen.
3
+
4
+ Fixes #24185, #28718.
5
+
6
+ *Matthew Draper*
7
+
8
+ * Avoid converting integer as a string into float.
9
+
10
+ *namusyaka*
11
+
12
+
1
13
  ## Rails 5.0.2 (March 01, 2017) ##
2
14
 
3
15
  * No changes.
@@ -372,7 +372,7 @@ module ActiveModel
372
372
 
373
373
  To achieve the same use:
374
374
 
375
- errors.add(attribute, :empty, options) if value.blank?
375
+ errors.add(attribute, :blank, options) if value.blank?
376
376
  MESSAGE
377
377
 
378
378
  Array(attributes).each do |attribute|
@@ -7,7 +7,7 @@ module ActiveModel
7
7
  module VERSION
8
8
  MAJOR = 5
9
9
  MINOR = 0
10
- TINY = 2
10
+ TINY = 3
11
11
  PRE = nil
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
@@ -11,9 +11,14 @@ module ActiveModel
11
11
 
12
12
  private
13
13
 
14
- def cast_value(value)
15
- ::String.new(super)
16
- end
14
+ def cast_value(value)
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
21
+ end
17
22
  end
18
23
  end
19
24
  end
@@ -73,6 +73,7 @@ module ActiveModel
73
73
  end
74
74
 
75
75
  def parse_raw_value_as_a_number(raw_value)
76
+ return raw_value.to_i if is_integer?(raw_value)
76
77
  Kernel.Float(raw_value) if raw_value !~ /\A0[xX]/
77
78
  end
78
79
 
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.2
4
+ version: 5.0.3
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-01 00:00:00.000000000 Z
11
+ date: 2017-05-12 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.2
19
+ version: 5.0.3
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.2
26
+ version: 5.0.3
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.
@@ -118,3 +118,4 @@ 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: