activemodel 7.0.6 → 7.0.7

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: 88150733324b801dc2198570a32ef11184c4865a2cb3fbccd405ac31dad489a6
4
- data.tar.gz: 6d7ce343da16108e59c8362526dc898adba71d6837cbe695a3fd8bd30ad2eb08
3
+ metadata.gz: c1d935ffe7c3758887e72e2ebd745a16b77b0a26936c94d29137d51fe943eb0b
4
+ data.tar.gz: b39a59430605c3118e29dac9578c5277e9ff0daad247cdb58919833ccfdc3a7c
5
5
  SHA512:
6
- metadata.gz: 6fee121b0166ed0a83926f5d575cc700d7267d4c5b87d0dc4cdbd5d0c5eed376e15688c5aa884af7375548a55a20138a16a2fc0c999289c5de0b1b49631213c8
7
- data.tar.gz: c9d3ceceb28ed93fa597d1cd41d727ee63022e74849e79a9ee5f7a9202beeddb41e15e69103009768b46ce8be82cf5f43b84b06e88db32cc7fd82c4e3ffb1efe
6
+ metadata.gz: b6da0ff0e553377d6dbcda253122f714b83757a1693d99533c4ac12da23582d0615682a737fadb1b92d768cbcf3890ba60c684341fcfb13bb96551fdccaaa3b7
7
+ data.tar.gz: 514153571f0506c683f447ad725d455cc11b6a7c7f964bcdaf2626ff46073500d1f4d7992fb703f4a8eded40e039bffb066baf664e8199ae453ccbef0d0f083e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## Rails 7.0.7 (August 09, 2023) ##
2
+
3
+ * Error.full_message now strips ":base" from the message.
4
+
5
+ *zzak*
6
+
7
+ * Add a load hook for `ActiveModel::Model` (named `active_model`) to match the load hook for
8
+ `ActiveRecord::Base` and allow for overriding aspects of the `ActiveModel::Model` class.
9
+
10
+
1
11
  ## Rails 7.0.6 (June 29, 2023) ##
2
12
 
3
13
  * No changes.
@@ -415,7 +415,7 @@ module ActiveModel
415
415
  @prefix = prefix
416
416
  @suffix = suffix
417
417
  @parameters = parameters.nil? ? FORWARD_PARAMETERS : parameters
418
- @regex = /^(?:#{Regexp.escape(@prefix)})(.*)(?:#{Regexp.escape(@suffix)})$/
418
+ @regex = /\A(?:#{Regexp.escape(@prefix)})(.*)(?:#{Regexp.escape(@suffix)})\z/
419
419
  @target = "#{@prefix}attribute#{@suffix}"
420
420
  @method_name = "#{prefix}%s#{suffix}"
421
421
  end
@@ -49,7 +49,7 @@ module ActiveModel
49
49
  defaults << :"errors.format"
50
50
  defaults << "%{attribute} %{message}"
51
51
 
52
- attr_name = attribute.tr(".", "_").humanize
52
+ attr_name = attribute.remove(/\.base\z/).tr(".", "_").humanize
53
53
  attr_name = base_class.human_attribute_name(attribute, {
54
54
  default: attr_name,
55
55
  base: base,
@@ -9,7 +9,7 @@ module ActiveModel
9
9
  module VERSION
10
10
  MAJOR = 7
11
11
  MINOR = 0
12
- TINY = 6
12
+ TINY = 7
13
13
  PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
@@ -4,10 +4,6 @@ module ActiveModel
4
4
  module Type
5
5
  module Helpers # :nodoc: all
6
6
  module Mutable
7
- def immutable_value(value)
8
- value.deep_dup.freeze
9
- end
10
-
11
7
  def cast(value)
12
8
  deserialize(serialize(value))
13
9
  end
@@ -18,6 +14,10 @@ module ActiveModel
18
14
  def changed_in_place?(raw_old_value, new_value)
19
15
  raw_old_value != serialize(new_value)
20
16
  end
17
+
18
+ def mutable? # :nodoc:
19
+ true
20
+ end
21
21
  end
22
22
  end
23
23
  end
@@ -121,8 +121,12 @@ module ActiveModel
121
121
  def assert_valid_value(_)
122
122
  end
123
123
 
124
- def immutable_value(value) # :nodoc:
125
- value
124
+ def serialized? # :nodoc:
125
+ false
126
+ end
127
+
128
+ def mutable? # :nodoc:
129
+ false
126
130
  end
127
131
 
128
132
  private
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: 7.0.6
4
+ version: 7.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-29 00:00:00.000000000 Z
11
+ date: 2023-08-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: 7.0.6
19
+ version: 7.0.7
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: 7.0.6
26
+ version: 7.0.7
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.
@@ -107,12 +107,12 @@ licenses:
107
107
  - MIT
108
108
  metadata:
109
109
  bug_tracker_uri: https://github.com/rails/rails/issues
110
- changelog_uri: https://github.com/rails/rails/blob/v7.0.6/activemodel/CHANGELOG.md
111
- documentation_uri: https://api.rubyonrails.org/v7.0.6/
110
+ changelog_uri: https://github.com/rails/rails/blob/v7.0.7/activemodel/CHANGELOG.md
111
+ documentation_uri: https://api.rubyonrails.org/v7.0.7/
112
112
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
113
- source_code_uri: https://github.com/rails/rails/tree/v7.0.6/activemodel
113
+ source_code_uri: https://github.com/rails/rails/tree/v7.0.7/activemodel
114
114
  rubygems_mfa_required: 'true'
115
- post_install_message:
115
+ post_install_message:
116
116
  rdoc_options: []
117
117
  require_paths:
118
118
  - lib
@@ -127,8 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  - !ruby/object:Gem::Version
128
128
  version: '0'
129
129
  requirements: []
130
- rubygems_version: 3.4.13
131
- signing_key:
130
+ rubygems_version: 3.4.10
131
+ signing_key:
132
132
  specification_version: 4
133
133
  summary: A toolkit for building modeling frameworks (part of Rails).
134
134
  test_files: []