activemodel 6.1.1 → 6.1.2

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
  SHA256:
3
- metadata.gz: 1937df0b1af18e0326626c8f858a6e6501813cba660f2188fbba100e18f81b29
4
- data.tar.gz: 040232f4c019839db999ebe1ab4d9b30a3544225e803347044c9b389a16ad09b
3
+ metadata.gz: '08df17982afa4c16f01d3f9c07f60cc5817641626e071a40d6b9a3765672ba4a'
4
+ data.tar.gz: 51909d78d21a89d88a27278f6f19a7f97971c78d058be06261431f141e0c7392
5
5
  SHA512:
6
- metadata.gz: 7a4d9196a4c73873b521dde3bca04bf26203299dcfa3532bc21f7d3996f29c7cbc1bc5d32037a4526a40e56927ab2d6eb1c5624c8804c9c67454db1b2f952941
7
- data.tar.gz: 3a7965fe5d4fae322d1914b4d52479b39fad097c73258240a5cd7d889229e9235328e86f49f23e38b1c3dc21b6ed02e0caf723fb27214e7d5c36c8593286ee1d
6
+ metadata.gz: b1968baa6cfe661631c0036dc4e544272f7ca3d1b136e93afa77e3c6c78605ce3c05196df85862f9a03eb612cb32ca65aacd392f0a13c6ecd58b0c9ae452fa3a
7
+ data.tar.gz: e038c7e4cad1354ce7a763e43b003a02b0470343494fbe0da45070c8f205d2f0bef4c3f9900fc492dc588b5a6331fc2bdc2b044d450e3a266cc32c502d98f00b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## Rails 6.1.2 (February 09, 2021) ##
2
+
3
+ * No changes.
4
+
5
+
1
6
  ## Rails 6.1.1 (January 07, 2021) ##
2
7
 
3
8
  * No changes.
data/README.rdoc CHANGED
@@ -241,7 +241,7 @@ The latest version of Active Model can be installed with RubyGems:
241
241
 
242
242
  Source code can be downloaded as part of the Rails project on GitHub
243
243
 
244
- * https://github.com/rails/rails/tree/master/activemodel
244
+ * https://github.com/rails/rails/tree/main/activemodel
245
245
 
246
246
 
247
247
  == License
@@ -164,10 +164,10 @@ module ActiveModel
164
164
  type.deserialize(value)
165
165
  end
166
166
 
167
- def _original_value_for_database
168
- value_before_type_cast
169
- end
170
- private :_original_value_for_database
167
+ private
168
+ def _original_value_for_database
169
+ value_before_type_cast
170
+ end
171
171
  end
172
172
 
173
173
  class FromUser < Attribute # :nodoc:
@@ -9,7 +9,7 @@ module ActiveModel
9
9
  module VERSION
10
10
  MAJOR = 6
11
11
  MINOR = 1
12
- TINY = 1
12
+ TINY = 2
13
13
  PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
@@ -64,6 +64,8 @@ module ActiveModel
64
64
  def parse_as_number(raw_value, precision, scale)
65
65
  if raw_value.is_a?(Float)
66
66
  parse_float(raw_value, precision, scale)
67
+ elsif raw_value.is_a?(BigDecimal)
68
+ round(raw_value, scale)
67
69
  elsif raw_value.is_a?(Numeric)
68
70
  raw_value
69
71
  elsif is_integer?(raw_value)
@@ -74,7 +76,11 @@ module ActiveModel
74
76
  end
75
77
 
76
78
  def parse_float(raw_value, precision, scale)
77
- (scale ? raw_value.truncate(scale) : raw_value).to_d(precision)
79
+ round(raw_value, scale).to_d(precision)
80
+ end
81
+
82
+ def round(raw_value, scale)
83
+ scale ? raw_value.round(scale) : raw_value
78
84
  end
79
85
 
80
86
  def is_number?(raw_value, precision, scale)
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: 6.1.1
4
+ version: 6.1.2
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: 2021-01-07 00:00:00.000000000 Z
11
+ date: 2021-02-09 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: 6.1.1
19
+ version: 6.1.2
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: 6.1.1
26
+ version: 6.1.2
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.
@@ -104,10 +104,10 @@ licenses:
104
104
  - MIT
105
105
  metadata:
106
106
  bug_tracker_uri: https://github.com/rails/rails/issues
107
- changelog_uri: https://github.com/rails/rails/blob/v6.1.1/activemodel/CHANGELOG.md
108
- documentation_uri: https://api.rubyonrails.org/v6.1.1/
107
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.2/activemodel/CHANGELOG.md
108
+ documentation_uri: https://api.rubyonrails.org/v6.1.2/
109
109
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
110
- source_code_uri: https://github.com/rails/rails/tree/v6.1.1/activemodel
110
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.2/activemodel
111
111
  post_install_message:
112
112
  rdoc_options: []
113
113
  require_paths: