activemodel 7.2.0.beta3 → 7.2.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: 396169eea4f8612b0db751778ec46eeed05e2fc4dfeefb5b8762a5e6e2589ae4
4
- data.tar.gz: '09d668e0a70dd17d0504dff67f5604f721afa8d513dac77d2d7cc34305218d76'
3
+ metadata.gz: 65d716f60254cf1514daf9344931dac7c1a4149a9595c925b71ef5ed41ce9faf
4
+ data.tar.gz: db0e27395b659927de0eb0084697c6a6446adeddf48ed7169cd681509248e0b2
5
5
  SHA512:
6
- metadata.gz: d6a9d8fd13108700abf7c304abf11096b7e18e7dcd22f4362dd408ededdc688792fd1345f611300fa6455633881c55a712d39efa265852e26a54ab543f4daaee
7
- data.tar.gz: 3f29c7beb890c1c8f364538ad3a98cd63f054bde1610bfc35258eea8af108873f9e4ab4612b13a51f82784fe5954a0ce097f1ddc581cac679901a7154b4ca245
6
+ metadata.gz: 0d0c66772a129c17799a17f1b098084ccc968fdebb7324b64d85f034af6473187387484d620e6653cde7c0eaf58d978d1ed920878e6ac811863dcbee80318baf
7
+ data.tar.gz: 01ac7b8cfc428b2ad337edb78f8cf5df23221e343a1e657158fe4b5a8f56e25dec4727cd680aa397ad40001d264fcc7213df15545c9f4bd7b2aff8caa53008f8
data/CHANGELOG.md CHANGED
@@ -1,14 +1,4 @@
1
- ## Rails 7.2.0.beta3 (July 11, 2024) ##
2
-
3
- * No changes.
4
-
5
-
6
- ## Rails 7.2.0.beta2 (June 04, 2024) ##
7
-
8
- * No changes.
9
-
10
-
11
- ## Rails 7.2.0.beta1 (May 29, 2024) ##
1
+ ## Rails 7.2.0 (August 09, 2024) ##
12
2
 
13
3
  * Fix a bug where type casting of string to `Time` and `DateTime` doesn't
14
4
  calculate minus minute value in TZ offset correctly.
@@ -10,7 +10,7 @@ module ActiveModel
10
10
  MAJOR = 7
11
11
  MINOR = 2
12
12
  TINY = 0
13
- PRE = "beta3"
13
+ PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -70,18 +70,33 @@ module ActiveModel
70
70
  /x
71
71
 
72
72
  if RUBY_VERSION >= "3.2"
73
- def fast_string_to_time(string)
74
- return unless ISO_DATETIME.match?(string)
75
-
76
- if is_utc?
77
- # XXX: Wrapping the Time object with Time.at because Time.new with `in:` in Ruby 3.2.0 used to return an invalid Time object
78
- # see: https://bugs.ruby-lang.org/issues/19292
79
- ::Time.at(::Time.new(string, in: "UTC"))
80
- else
81
- ::Time.new(string)
73
+ if Time.new(2000, 1, 1, 0, 0, 0, "-00:00").yday != 1 # Early 3.2.x had a bug
74
+ # BUG: Wrapping the Time object with Time.at because Time.new with `in:` in Ruby 3.2.0
75
+ # used to return an invalid Time object
76
+ # see: https://bugs.ruby-lang.org/issues/19292
77
+ def fast_string_to_time(string)
78
+ return unless string.include?("-") # Time.new("1234") # => 1234-01-01 00:00:00
79
+
80
+ if is_utc?
81
+ ::Time.at(::Time.new(string, in: "UTC"))
82
+ else
83
+ ::Time.new(string)
84
+ end
85
+ rescue ArgumentError
86
+ nil
87
+ end
88
+ else
89
+ def fast_string_to_time(string)
90
+ return unless string.include?("-") # Time.new("1234") # => 1234-01-01 00:00:00
91
+
92
+ if is_utc?
93
+ ::Time.new(string, in: "UTC")
94
+ else
95
+ ::Time.new(string)
96
+ end
97
+ rescue ArgumentError
98
+ nil
82
99
  end
83
- rescue ArgumentError
84
- nil
85
100
  end
86
101
  else
87
102
  def fast_string_to_time(string)
@@ -7,7 +7,11 @@ module ActiveModel
7
7
  module Helpers # :nodoc: all
8
8
  module Timezone
9
9
  def is_utc?
10
- ::Time.zone_default.nil? || ::Time.zone_default.match?("UTC")
10
+ if default = ::Time.zone_default
11
+ default.name == "UTC"
12
+ else
13
+ true
14
+ end
11
15
  end
12
16
 
13
17
  def default_timezone
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.2.0.beta3
4
+ version: 7.2.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: 2024-07-11 00:00:00.000000000 Z
11
+ date: 2024-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.2.0.beta3
19
+ version: 7.2.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: 7.2.0.beta3
26
+ version: 7.2.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.
@@ -112,10 +112,10 @@ licenses:
112
112
  - MIT
113
113
  metadata:
114
114
  bug_tracker_uri: https://github.com/rails/rails/issues
115
- changelog_uri: https://github.com/rails/rails/blob/v7.2.0.beta3/activemodel/CHANGELOG.md
116
- documentation_uri: https://api.rubyonrails.org/v7.2.0.beta3/
115
+ changelog_uri: https://github.com/rails/rails/blob/v7.2.0/activemodel/CHANGELOG.md
116
+ documentation_uri: https://api.rubyonrails.org/v7.2.0/
117
117
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
118
- source_code_uri: https://github.com/rails/rails/tree/v7.2.0.beta3/activemodel
118
+ source_code_uri: https://github.com/rails/rails/tree/v7.2.0/activemodel
119
119
  rubygems_mfa_required: 'true'
120
120
  post_install_message:
121
121
  rdoc_options: []