activemodel 7.2.0.beta3 → 7.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -11
- data/lib/active_model/gem_version.rb +1 -1
- data/lib/active_model/type/helpers/time_value.rb +26 -11
- data/lib/active_model/type/helpers/timezone.rb +5 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65d716f60254cf1514daf9344931dac7c1a4149a9595c925b71ef5ed41ce9faf
|
4
|
+
data.tar.gz: db0e27395b659927de0eb0084697c6a6446adeddf48ed7169cd681509248e0b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d0c66772a129c17799a17f1b098084ccc968fdebb7324b64d85f034af6473187387484d620e6653cde7c0eaf58d978d1ed920878e6ac811863dcbee80318baf
|
7
|
+
data.tar.gz: 01ac7b8cfc428b2ad337edb78f8cf5df23221e343a1e657158fe4b5a8f56e25dec4727cd680aa397ad40001d264fcc7213df15545c9f4bd7b2aff8caa53008f8
|
data/CHANGELOG.md
CHANGED
@@ -1,14 +1,4 @@
|
|
1
|
-
## Rails 7.2.0
|
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.
|
@@ -70,18 +70,33 @@ module ActiveModel
|
|
70
70
|
/x
|
71
71
|
|
72
72
|
if RUBY_VERSION >= "3.2"
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
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
|
-
|
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
|
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-
|
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
|
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
|
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
|
116
|
-
documentation_uri: https://api.rubyonrails.org/v7.2.0
|
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
|
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: []
|