activemodel 6.1.0.rc2 → 6.1.0

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
  SHA256:
3
- metadata.gz: 73897389085a337d37fd217732c23d639014f9ef7bba9928553000d40826838c
4
- data.tar.gz: 1451352712ab5c35dc23e010aa7cd6eeb4aa720966a9632b738a2840f3215b74
3
+ metadata.gz: 1caa114ce8c604cb9ac388ef4ebbfd796f8ff253799322db9fa714193bca6821
4
+ data.tar.gz: 49f8fb7f47a3154022161dee9871d6aba46f7750b3381e690e37d7ff2663ef48
5
5
  SHA512:
6
- metadata.gz: f60de09baec917855aef1dbb43cd18aa50c79ef1ce1a7984a585677a9b13dba4aa5305eb7404db02076b6dd4189364d20ac0025084927544a1fea7e945d1cd3b
7
- data.tar.gz: 186b7fa9b0cf4c20777ffcafefba10372d7a919a5b33df2e650cfae6febee16a9031b0bdacd39b2cfd5d1c388644fee41cb8d6e587b20dbfa896a424466c33e1
6
+ metadata.gz: 26271099e8c36f89e1ee19fcb3469be914240ea887f15aba4d0de79b3db57f17d8467f523010330ba4f70e4df01d14398a6db7687df0a9be674f17ffd284be5d
7
+ data.tar.gz: e32d32dac693b8cae0445b2b9634345688b4010ecd4cbda054288934b4d0aeb353486415b55934e2c298fc8ab09655712ede1214e175ef4b67fe8af80926bb86
@@ -1,9 +1,4 @@
1
- ## Rails 6.1.0.rc2 (December 01, 2020) ##
2
-
3
- * No changes.
4
-
5
-
6
- ## Rails 6.1.0.rc1 (November 02, 2020) ##
1
+ ## Rails 6.1.0 (December 09, 2020) ##
7
2
 
8
3
  * Pass in `base` instead of `base_class` to Error.human_attribute_name
9
4
 
@@ -10,7 +10,7 @@ module ActiveModel
10
10
  MAJOR = 6
11
11
  MINOR = 1
12
12
  TINY = 0
13
- PRE = "rc2"
13
+ PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -108,8 +108,8 @@ module ActiveModel
108
108
  end
109
109
  end
110
110
 
111
- def read_attribute_for_validation(record, attr_name)
112
- return super if record_attribute_changed_in_place?(record, attr_name)
111
+ def prepare_value_for_validation(value, record, attr_name)
112
+ return value if record_attribute_changed_in_place?(record, attr_name)
113
113
 
114
114
  came_from_user = :"#{attr_name}_came_from_user?"
115
115
 
@@ -126,7 +126,7 @@ module ActiveModel
126
126
  end
127
127
  end
128
128
 
129
- raw_value || super
129
+ raw_value || value
130
130
  end
131
131
 
132
132
  def record_attribute_changed_in_place?(record, attr_name)
@@ -147,8 +147,9 @@ module ActiveModel
147
147
  # override +validate_each+ with validation logic.
148
148
  def validate(record)
149
149
  attributes.each do |attribute|
150
- value = read_attribute_for_validation(record, attribute)
150
+ value = record.read_attribute_for_validation(attribute)
151
151
  next if (value.nil? && options[:allow_nil]) || (value.blank? && options[:allow_blank])
152
+ value = prepare_value_for_validation(value, record, attribute)
152
153
  validate_each(record, attribute, value)
153
154
  end
154
155
  end
@@ -166,8 +167,8 @@ module ActiveModel
166
167
  end
167
168
 
168
169
  private
169
- def read_attribute_for_validation(record, attr_name)
170
- record.read_attribute_for_validation(attr_name)
170
+ def prepare_value_for_validation(value, record, attr_name)
171
+ value
171
172
  end
172
173
  end
173
174
 
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.0.rc2
4
+ version: 6.1.0
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: 2020-12-01 00:00:00.000000000 Z
11
+ date: 2020-12-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.0.rc2
19
+ version: 6.1.0
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.0.rc2
26
+ version: 6.1.0
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.0.rc2/activemodel/CHANGELOG.md
108
- documentation_uri: https://api.rubyonrails.org/v6.1.0.rc2/
107
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.0/activemodel/CHANGELOG.md
108
+ documentation_uri: https://api.rubyonrails.org/v6.1.0/
109
109
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
110
- source_code_uri: https://github.com/rails/rails/tree/v6.1.0.rc2/activemodel
110
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.0/activemodel
111
111
  post_install_message:
112
112
  rdoc_options: []
113
113
  require_paths:
@@ -119,9 +119,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
119
  version: 2.5.0
120
120
  required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 1.3.1
124
+ version: '0'
125
125
  requirements: []
126
126
  rubygems_version: 3.1.4
127
127
  signing_key: