activesupport 6.0.3 → 6.1.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activesupport might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +341 -455
- data/MIT-LICENSE +1 -1
- data/lib/active_support.rb +13 -1
- data/lib/active_support/array_inquirer.rb +4 -2
- data/lib/active_support/backtrace_cleaner.rb +3 -3
- data/lib/active_support/benchmarkable.rb +1 -1
- data/lib/active_support/cache.rb +80 -39
- data/lib/active_support/cache/file_store.rb +4 -3
- data/lib/active_support/cache/mem_cache_store.rb +20 -23
- data/lib/active_support/cache/memory_store.rb +38 -26
- data/lib/active_support/cache/redis_cache_store.rb +31 -26
- data/lib/active_support/cache/strategy/local_cache.rb +14 -5
- data/lib/active_support/callbacks.rb +65 -56
- data/lib/active_support/concern.rb +46 -2
- data/lib/active_support/configurable.rb +3 -3
- data/lib/active_support/configuration_file.rb +46 -0
- data/lib/active_support/core_ext/benchmark.rb +2 -2
- data/lib/active_support/core_ext/class/attribute.rb +34 -44
- data/lib/active_support/core_ext/class/subclasses.rb +17 -38
- data/lib/active_support/core_ext/date/conversions.rb +2 -1
- data/lib/active_support/core_ext/date_and_time/calculations.rb +13 -0
- data/lib/active_support/core_ext/date_and_time/compatibility.rb +15 -0
- data/lib/active_support/core_ext/enumerable.rb +76 -4
- data/lib/active_support/core_ext/hash/conversions.rb +2 -2
- data/lib/active_support/core_ext/hash/deep_transform_values.rb +1 -1
- data/lib/active_support/core_ext/hash/except.rb +1 -1
- data/lib/active_support/core_ext/hash/keys.rb +1 -1
- data/lib/active_support/core_ext/hash/slice.rb +3 -2
- data/lib/active_support/core_ext/load_error.rb +1 -1
- data/lib/active_support/core_ext/marshal.rb +2 -0
- data/lib/active_support/core_ext/module/attr_internal.rb +2 -2
- data/lib/active_support/core_ext/module/attribute_accessors.rb +23 -29
- data/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb +8 -4
- data/lib/active_support/core_ext/module/concerning.rb +8 -2
- data/lib/active_support/core_ext/module/delegation.rb +38 -28
- data/lib/active_support/core_ext/module/introspection.rb +1 -25
- data/lib/active_support/core_ext/name_error.rb +29 -2
- data/lib/active_support/core_ext/numeric/conversions.rb +22 -18
- data/lib/active_support/core_ext/object/deep_dup.rb +1 -1
- data/lib/active_support/core_ext/object/json.rb +6 -2
- data/lib/active_support/core_ext/object/try.rb +2 -2
- data/lib/active_support/core_ext/range/compare_range.rb +9 -3
- data/lib/active_support/core_ext/range/include_time_with_zone.rb +8 -3
- data/lib/active_support/core_ext/string/access.rb +5 -24
- data/lib/active_support/core_ext/string/inflections.rb +38 -4
- data/lib/active_support/core_ext/string/inquiry.rb +1 -0
- data/lib/active_support/core_ext/string/multibyte.rb +2 -2
- data/lib/active_support/core_ext/string/output_safety.rb +2 -3
- data/lib/active_support/core_ext/string/starts_ends_with.rb +2 -2
- data/lib/active_support/core_ext/symbol.rb +3 -0
- data/lib/active_support/core_ext/symbol/starts_ends_with.rb +14 -0
- data/lib/active_support/core_ext/time/calculations.rb +19 -1
- data/lib/active_support/core_ext/time/conversions.rb +1 -0
- data/lib/active_support/core_ext/uri.rb +5 -1
- data/lib/active_support/current_attributes.rb +7 -2
- data/lib/active_support/current_attributes/test_helper.rb +13 -0
- data/lib/active_support/dependencies.rb +37 -18
- data/lib/active_support/deprecation.rb +6 -1
- data/lib/active_support/deprecation/behaviors.rb +15 -2
- data/lib/active_support/deprecation/disallowed.rb +56 -0
- data/lib/active_support/deprecation/instance_delegator.rb +0 -1
- data/lib/active_support/deprecation/method_wrappers.rb +3 -2
- data/lib/active_support/deprecation/proxy_wrappers.rb +3 -3
- data/lib/active_support/deprecation/reporting.rb +50 -7
- data/lib/active_support/descendants_tracker.rb +6 -2
- data/lib/active_support/duration.rb +71 -22
- data/lib/active_support/duration/iso8601_serializer.rb +15 -9
- data/lib/active_support/encrypted_file.rb +19 -2
- data/lib/active_support/environment_inquirer.rb +20 -0
- data/lib/active_support/evented_file_update_checker.rb +69 -133
- data/lib/active_support/fork_tracker.rb +58 -0
- data/lib/active_support/gem_version.rb +3 -3
- data/lib/active_support/hash_with_indifferent_access.rb +35 -22
- data/lib/active_support/i18n_railtie.rb +14 -19
- data/lib/active_support/inflector/inflections.rb +1 -2
- data/lib/active_support/inflector/methods.rb +35 -31
- data/lib/active_support/inflector/transliterate.rb +4 -4
- data/lib/active_support/json/decoding.rb +4 -4
- data/lib/active_support/json/encoding.rb +5 -1
- data/lib/active_support/key_generator.rb +1 -1
- data/lib/active_support/locale/en.yml +7 -3
- data/lib/active_support/log_subscriber.rb +8 -0
- data/lib/active_support/logger.rb +1 -1
- data/lib/active_support/logger_silence.rb +2 -26
- data/lib/active_support/logger_thread_safe_level.rb +34 -12
- data/lib/active_support/message_encryptor.rb +4 -7
- data/lib/active_support/message_verifier.rb +5 -5
- data/lib/active_support/messages/metadata.rb +9 -1
- data/lib/active_support/messages/rotation_configuration.rb +2 -1
- data/lib/active_support/messages/rotator.rb +6 -5
- data/lib/active_support/multibyte/chars.rb +4 -42
- data/lib/active_support/multibyte/unicode.rb +9 -83
- data/lib/active_support/notifications.rb +31 -4
- data/lib/active_support/notifications/fanout.rb +23 -8
- data/lib/active_support/notifications/instrumenter.rb +6 -15
- data/lib/active_support/number_helper.rb +29 -14
- data/lib/active_support/number_helper/number_converter.rb +1 -1
- data/lib/active_support/number_helper/number_to_currency_converter.rb +3 -7
- data/lib/active_support/number_helper/number_to_human_converter.rb +1 -1
- data/lib/active_support/number_helper/number_to_human_size_converter.rb +1 -1
- data/lib/active_support/number_helper/number_to_rounded_converter.rb +3 -3
- data/lib/active_support/number_helper/rounding_helper.rb +12 -28
- data/lib/active_support/option_merger.rb +3 -2
- data/lib/active_support/ordered_options.rb +8 -2
- data/lib/active_support/parameter_filter.rb +15 -10
- data/lib/active_support/per_thread_registry.rb +1 -1
- data/lib/active_support/rails.rb +1 -4
- data/lib/active_support/railtie.rb +23 -1
- data/lib/active_support/secure_compare_rotator.rb +51 -0
- data/lib/active_support/security_utils.rb +19 -12
- data/lib/active_support/string_inquirer.rb +4 -2
- data/lib/active_support/subscriber.rb +12 -7
- data/lib/active_support/tagged_logging.rb +29 -4
- data/lib/active_support/testing/assertions.rb +18 -11
- data/lib/active_support/testing/parallelization.rb +12 -95
- data/lib/active_support/testing/parallelization/server.rb +78 -0
- data/lib/active_support/testing/parallelization/worker.rb +100 -0
- data/lib/active_support/testing/time_helpers.rb +40 -3
- data/lib/active_support/time_with_zone.rb +66 -42
- data/lib/active_support/values/time_zone.rb +20 -10
- data/lib/active_support/xml_mini/rexml.rb +8 -1
- metadata +36 -38
- data/lib/active_support/core_ext/array/prepend_and_append.rb +0 -5
- data/lib/active_support/core_ext/hash/compact.rb +0 -5
- data/lib/active_support/core_ext/hash/transform_values.rb +0 -5
- data/lib/active_support/core_ext/module/reachable.rb +0 -6
- data/lib/active_support/core_ext/numeric/inquiry.rb +0 -5
- data/lib/active_support/core_ext/range/include_range.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e3b1535797c76aeec9ce935c778ef87ef0607bf156916734c1b9ad789f4666d
|
4
|
+
data.tar.gz: aaa132d9325b4dcefabe7e4b379a8709cc7cfcdbca7e0a663b63d75e213353c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 400e5ad4e88a2c8a82c1514b5c5ac9c30edd0e4fed6b22348ec11ab408db5478dad0dfdc1711e3f70b1a98343071583de1d4ad98cdce1bd7860008c229676d8a
|
7
|
+
data.tar.gz: 2481dadc58812a57876a1d2ed559adeaaba012d144a8e2f7f3076cb51ad7ec2da63224f334d7fdfac8e3dd00fab2c6b8bff8f25efd3622f67a6bcb2f9cd9c674
|
data/CHANGELOG.md
CHANGED
@@ -1,660 +1,546 @@
|
|
1
|
-
## Rails 6.0.
|
1
|
+
## Rails 6.1.0.rc1 (November 02, 2020) ##
|
2
2
|
|
3
|
-
* `
|
4
|
-
|
5
|
-
Before:
|
6
|
-
|
7
|
-
['one', 'two'].to_sentence.frozen?
|
8
|
-
# => true
|
9
|
-
|
10
|
-
After:
|
11
|
-
|
12
|
-
['one', 'two'].to_sentence.frozen?
|
13
|
-
# => false
|
14
|
-
|
15
|
-
*Nicolas Dular*
|
16
|
-
|
17
|
-
* Update `ActiveSupport::Messages::Metadata#fresh?` to work for cookies with expiry set when
|
18
|
-
`ActiveSupport.parse_json_times = true`.
|
3
|
+
* Calling `iso8601` on negative durations retains the negative sign on individual
|
4
|
+
digits instead of prepending it.
|
19
5
|
|
20
|
-
|
6
|
+
This change is required so we can interoperate with PostgreSQL, which prefers
|
7
|
+
negative signs for each component.
|
21
8
|
|
9
|
+
Compatibility with other iso8601 parsers which support leading negatives as well
|
10
|
+
as negatives per component is still retained.
|
22
11
|
|
23
|
-
|
12
|
+
Before:
|
24
13
|
|
25
|
-
|
14
|
+
(-1.year - 1.day).iso8601
|
15
|
+
# => "-P1Y1D"
|
26
16
|
|
17
|
+
After:
|
27
18
|
|
28
|
-
|
19
|
+
(-1.year - 1.day).iso8601
|
20
|
+
# => "P-1Y-1D"
|
29
21
|
|
30
|
-
*
|
22
|
+
*Vipul A M*
|
31
23
|
|
24
|
+
* Remove deprecated `ActiveSupport::Notifications::Instrumenter#end=`.
|
32
25
|
|
33
|
-
|
26
|
+
*Rafael Mendonça França*
|
34
27
|
|
35
|
-
*
|
28
|
+
* Deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`.
|
36
29
|
|
37
|
-
*
|
30
|
+
*Rafael Mendonça França*
|
38
31
|
|
39
|
-
*
|
32
|
+
* Remove deprecated `ActiveSupport::Multibyte::Unicode.pack_graphemes`,
|
33
|
+
`ActiveSupport::Multibyte::Unicode.unpack_graphemes`,
|
34
|
+
`ActiveSupport::Multibyte::Unicode.normalize`,
|
35
|
+
`ActiveSupport::Multibyte::Unicode.downcase`,
|
36
|
+
`ActiveSupport::Multibyte::Unicode.upcase` and `ActiveSupport::Multibyte::Unicode.swapcase`.
|
40
37
|
|
41
|
-
*
|
38
|
+
*Rafael Mendonça França*
|
42
39
|
|
40
|
+
* Remove deprecated `ActiveSupport::Multibyte::Chars#consumes?` and `ActiveSupport::Multibyte::Chars#normalize`.
|
43
41
|
|
44
|
-
|
42
|
+
*Rafael Mendonça França*
|
45
43
|
|
46
|
-
*
|
44
|
+
* Remove deprecated file `active_support/core_ext/range/include_range`.
|
47
45
|
|
48
|
-
*
|
46
|
+
*Rafael Mendonça França*
|
49
47
|
|
50
|
-
*
|
51
|
-
of clients reached" error.
|
48
|
+
* Remove deprecated file `active_support/core_ext/hash/transform_values`.
|
52
49
|
|
53
|
-
*
|
50
|
+
*Rafael Mendonça França*
|
54
51
|
|
55
|
-
*
|
56
|
-
unexpectedly change the cached value.
|
52
|
+
* Remove deprecated file `active_support/core_ext/hash/compact`.
|
57
53
|
|
58
|
-
*
|
54
|
+
*Rafael Mendonça França*
|
59
55
|
|
60
|
-
*
|
56
|
+
* Remove deprecated file `active_support/core_ext/array/prepend_and_append`.
|
61
57
|
|
62
|
-
|
63
|
-
# config/initializers/zeitwerk.rb
|
64
|
-
Rails.autoloaders.each do |autoloader|
|
65
|
-
autoloader.inflector.inflect(
|
66
|
-
"html_parser" => "HTMLParser",
|
67
|
-
"ssl_error" => "SSLError"
|
68
|
-
)
|
69
|
-
end
|
70
|
-
```
|
58
|
+
*Rafael Mendonça França*
|
71
59
|
|
72
|
-
|
60
|
+
* Remove deprecated file `active_support/core_ext/numeric/inquiry`.
|
73
61
|
|
74
|
-
|
62
|
+
*Rafael Mendonça França*
|
75
63
|
|
76
|
-
|
64
|
+
* Remove deprecated file `active_support/core_ext/module/reachable`.
|
77
65
|
|
78
|
-
*
|
79
|
-
and endless range targets.
|
66
|
+
*Rafael Mendonça França*
|
80
67
|
|
81
|
-
|
68
|
+
* Remove deprecated `Module#parent_name`, `Module#parent` and `Module#parents`.
|
82
69
|
|
83
|
-
*
|
70
|
+
*Rafael Mendonça França*
|
84
71
|
|
85
|
-
|
72
|
+
* Remove deprecated `ActiveSupport::LoggerThreadSafeLevel#after_initialize`.
|
86
73
|
|
74
|
+
*Rafael Mendonça França*
|
87
75
|
|
88
|
-
|
76
|
+
* Remove deprecated `LoggerSilence` constant.
|
89
77
|
|
90
|
-
*
|
91
|
-
better backwards compatibility.
|
78
|
+
*Rafael Mendonça França*
|
92
79
|
|
93
|
-
|
80
|
+
* Remove deprecated fallback to `I18n.default_local` when `config.i18n.fallbacks` is empty.
|
94
81
|
|
95
|
-
*
|
96
|
-
to `to_path` for better backwards compatibility.
|
82
|
+
*Rafael Mendonça França*
|
97
83
|
|
98
|
-
|
84
|
+
* Remove entries from local cache on `RedisCacheStore#delete_matched`
|
99
85
|
|
100
|
-
|
86
|
+
Fixes #38627
|
101
87
|
|
102
|
-
|
103
|
-
to make log level local to Ruby Fibers in addition to Threads.
|
88
|
+
*ojab*
|
104
89
|
|
105
|
-
|
90
|
+
* Speed up `ActiveSupport::SecurityUtils.fixed_length_secure_compare` by using
|
91
|
+
`OpenSSL.fixed_length_secure_compare`, if available.
|
106
92
|
|
107
|
-
|
108
|
-
logger.level = 1
|
109
|
-
p "Main is debug? #{logger.debug?}"
|
93
|
+
*Nate Matykiewicz*
|
110
94
|
|
111
|
-
|
112
|
-
logger.local_level = 0
|
113
|
-
p "Thread is debug? #{logger.debug?}"
|
114
|
-
}.resume
|
95
|
+
* `ActiveSupport::Cache::MemCacheStore` now checks `ENV["MEMCACHE_SERVERS"]` before falling back to `"localhost:11211"` if configured without any addresses.
|
115
96
|
|
116
|
-
|
97
|
+
```ruby
|
98
|
+
config.cache_store = :mem_cache_store
|
117
99
|
|
118
|
-
|
100
|
+
# is now equivalent to
|
119
101
|
|
120
|
-
|
121
|
-
Thread is debug? true
|
122
|
-
Main is debug? true
|
102
|
+
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"] || "localhost:11211"
|
123
103
|
|
124
|
-
|
104
|
+
# instead of
|
125
105
|
|
126
|
-
|
127
|
-
|
128
|
-
Main is debug? false
|
106
|
+
config.cache_store = :mem_cache_store, "localhost:11211" # ignores ENV["MEMCACHE_SERVERS"]
|
107
|
+
```
|
129
108
|
|
130
|
-
*
|
109
|
+
*Sam Bostock*
|
131
110
|
|
132
|
-
*
|
133
|
-
|
134
|
-
variables when calling `Marshal.dump(object)`, should the delegation target of
|
135
|
-
`object` be a method which would otherwise add them. Fixes #36522.
|
111
|
+
* `ActiveSupport::Subscriber#attach_to` now accepts an `inherit_all:` argument. When set to true,
|
112
|
+
it allows a subscriber to receive events for methods defined in the subscriber's ancestor class(es).
|
136
113
|
|
137
|
-
|
114
|
+
```ruby
|
115
|
+
class ActionControllerSubscriber < ActiveSupport::Subscriber
|
116
|
+
attach_to :action_controller
|
138
117
|
|
118
|
+
def start_processing(event)
|
119
|
+
info "Processing by #{event.payload[:controller]}##{event.payload[:action]} as #{format}"
|
120
|
+
end
|
139
121
|
|
140
|
-
|
122
|
+
def redirect_to(event)
|
123
|
+
info { "Redirected to #{event.payload[:location]}" }
|
124
|
+
end
|
125
|
+
end
|
141
126
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
with `gsub` and `strip`.
|
127
|
+
# We detach ActionControllerSubscriber from the :action_controller namespace so that our CustomActionControllerSubscriber
|
128
|
+
# can provide its own instrumentation for certain events in the namespace
|
129
|
+
ActionControllerSubscriber.detach_from(:action_controller)
|
146
130
|
|
147
|
-
|
131
|
+
class CustomActionControllerSubscriber < ActionControllerSubscriber
|
132
|
+
attach_to :action_controller, inherit_all: true
|
148
133
|
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
# => false
|
134
|
+
def start_processing(event)
|
135
|
+
info "A custom response to start_processing events"
|
136
|
+
end
|
153
137
|
|
154
|
-
|
138
|
+
# => CustomActionControllerSubscriber will process events for "start_processing.action_controller" notifications
|
139
|
+
# using its own #start_processing implementation, while retaining ActionControllerSubscriber's instrumentation
|
140
|
+
# for "redirect_to.action_controller" notifications
|
141
|
+
end
|
142
|
+
```
|
155
143
|
|
156
|
-
|
157
|
-
# => false
|
158
|
-
'foobar'.truncate(6).frozen?
|
159
|
-
# => false
|
144
|
+
*Adrianna Chang*
|
160
145
|
|
161
|
-
|
146
|
+
* Allow the digest class used to generate non-sensitive digests to be configured with `config.active_support.hash_digest_class`.
|
162
147
|
|
148
|
+
`config.active_support.use_sha1_digests` is deprecated in favour of `config.active_support.hash_digest_class = ::Digest::SHA1`.
|
163
149
|
|
164
|
-
|
150
|
+
*Dirkjan Bussink*
|
165
151
|
|
166
|
-
*
|
152
|
+
* Fix bug to make memcached write_entry expire correctly with unless_exist
|
167
153
|
|
168
|
-
|
169
|
-
can help you save time if you have a clear action for the resolution of
|
170
|
-
common development errors.
|
154
|
+
*Jye Lee*
|
171
155
|
|
172
|
-
|
173
|
-
are found, a middleware raises an error. With actionable errors, you can
|
174
|
-
run the migrations right from the error page. Other examples include Rails
|
175
|
-
plugins that need to run a rake task to setup themselves. They can now
|
176
|
-
raise actionable errors to run the setup straight from the error pages.
|
156
|
+
* Add `ActiveSupport::Duration` conversion methods
|
177
157
|
|
178
|
-
|
158
|
+
`in_seconds`, `in_minutes`, `in_hours`, `in_days`, `in_weeks`, `in_months`, and `in_years` return the respective duration covered.
|
179
159
|
|
180
|
-
|
181
|
-
class PendingMigrationError < MigrationError #:nodoc:
|
182
|
-
include ActiveSupport::ActionableError
|
160
|
+
*Jason York*
|
183
161
|
|
184
|
-
|
185
|
-
|
186
|
-
end
|
187
|
-
end
|
188
|
-
```
|
162
|
+
* Fixed issue in `ActiveSupport::Cache::RedisCacheStore` not passing options
|
163
|
+
to `read_multi` causing `fetch_multi` to not work properly
|
189
164
|
|
190
|
-
|
191
|
-
module and invoke the `action` class macro to define the action. An action
|
192
|
-
needs a name and a procedure to execute. The name is shown as the name of a
|
193
|
-
button on the error pages. Once clicked, it will invoke the given
|
194
|
-
procedure.
|
165
|
+
*Rajesh Sharma*
|
195
166
|
|
196
|
-
|
167
|
+
* Fixed issue in `ActiveSupport::Cache::MemCacheStore` which caused duplicate compression,
|
168
|
+
and caused the provided `compression_threshold` to not be respected.
|
197
169
|
|
198
|
-
*
|
170
|
+
*Max Gurewitz*
|
199
171
|
|
200
|
-
|
172
|
+
* Prevent `RedisCacheStore` and `MemCacheStore` from performing compression
|
173
|
+
when reading entries written with `raw: true`.
|
201
174
|
|
202
|
-
|
175
|
+
*Max Gurewitz*
|
203
176
|
|
204
|
-
|
205
|
-
|
206
|
-
("<br />".html_safe * 2).html_safe? #=> true
|
177
|
+
* `URI.parser` is deprecated and will be removed in Rails 6.2. Use
|
178
|
+
`URI::DEFAULT_PARSER` instead.
|
207
179
|
|
208
|
-
*
|
180
|
+
*Jean Boussier*
|
209
181
|
|
210
|
-
*
|
211
|
-
|
182
|
+
* `require_dependency` has been documented to be _obsolete_ in `:zeitwerk`
|
183
|
+
mode. The method is not deprecated as such (yet), but applications are
|
184
|
+
encouraged to not use it.
|
212
185
|
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
longer implements `autoloaded_constants` or `autoloaded?` (undocumented,
|
217
|
-
anyway). Experience shows introspection does not have many use cases, and
|
218
|
-
troubleshooting is done by logging. With this design trade-off we are able
|
219
|
-
to use even less memory in all environments.
|
186
|
+
In `:zeitwerk` mode, semantics match Ruby's and you do not need to be
|
187
|
+
defensive with load order. Just refer to classes and modules normally. If
|
188
|
+
the constant name is dynamic, camelize if needed, and constantize.
|
220
189
|
|
221
190
|
*Xavier Noria*
|
222
191
|
|
223
|
-
*
|
224
|
-
and hence uses less memory when `config.cache_classes` is `true`, a standard
|
225
|
-
setup in production.
|
226
|
-
|
227
|
-
*Xavier Noria*
|
192
|
+
* Add 3rd person aliases of `Symbol#start_with?` and `Symbol#end_with?`.
|
228
193
|
|
229
|
-
|
230
|
-
|
194
|
+
```ruby
|
195
|
+
:foo.starts_with?("f") # => true
|
196
|
+
:foo.ends_with?("o") # => true
|
197
|
+
```
|
231
198
|
|
232
|
-
|
233
|
-
not to `config.eager_load_paths`. In that configuration, for example, files
|
234
|
-
in the `lib` directory should not be eager loaded.
|
199
|
+
*Ryuta Kamizono*
|
235
200
|
|
236
|
-
|
201
|
+
* Add override of unary plus for `ActiveSupport::Duration`.
|
237
202
|
|
238
|
-
|
203
|
+
`+ 1.second` is now identical to `+1.second` to prevent errors
|
204
|
+
where a seemingly innocent change of formatting leads to a change in the code behavior.
|
239
205
|
|
240
206
|
Before:
|
241
|
-
|
242
|
-
|
207
|
+
```ruby
|
208
|
+
+1.second.class
|
209
|
+
# => ActiveSupport::Duration
|
210
|
+
(+ 1.second).class
|
211
|
+
# => Integer
|
212
|
+
```
|
243
213
|
|
244
214
|
After:
|
215
|
+
```ruby
|
216
|
+
+1.second.class
|
217
|
+
# => ActiveSupport::Duration
|
218
|
+
(+ 1.second).class
|
219
|
+
# => ActiveSupport::Duration
|
220
|
+
```
|
245
221
|
|
246
|
-
|
247
|
-
|
248
|
-
With the same change for `Range#include?` and `Range#===`.
|
249
|
-
|
250
|
-
*Owen Stephens*
|
251
|
-
|
252
|
-
* Use weak references in descendants tracker to allow anonymous subclasses to
|
253
|
-
be garbage collected.
|
254
|
-
|
255
|
-
*Edgars Beigarts*
|
256
|
-
|
257
|
-
* Update `ActiveSupport::Notifications::Instrumenter#instrument` to make
|
258
|
-
passing a block optional. This will let users use
|
259
|
-
`ActiveSupport::Notifications` messaging features outside of
|
260
|
-
instrumentation.
|
222
|
+
Fixes #39079.
|
261
223
|
|
262
|
-
*
|
224
|
+
*Roman Kushnir*
|
263
225
|
|
264
|
-
*
|
226
|
+
* Add subsec to `ActiveSupport::TimeWithZone#inspect`.
|
265
227
|
|
266
228
|
Before:
|
267
229
|
|
268
|
-
Time.
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
Time.
|
273
|
-
|
274
|
-
Note that this doesn't affect `DateTime#advance` as that doesn't use a proleptic calendar.
|
275
|
-
|
276
|
-
*Andrew White*
|
277
|
-
|
278
|
-
* In Zeitwerk mode, engines are now managed by the `main` autoloader. Engines may reference application constants, if the application is reloaded and we do not reload engines, they won't use the reloaded application code.
|
279
|
-
|
280
|
-
*Xavier Noria*
|
281
|
-
|
282
|
-
* Add support for supplying `locale` to `transliterate` and `parameterize`.
|
283
|
-
|
284
|
-
I18n.backend.store_translations(:de, i18n: { transliterate: { rule: { "ü" => "ue" } } })
|
285
|
-
|
286
|
-
ActiveSupport::Inflector.transliterate("ü", locale: :de) # => "ue"
|
287
|
-
"Fünf autos".parameterize(locale: :de) # => "fuenf-autos"
|
288
|
-
ActiveSupport::Inflector.parameterize("Fünf autos", locale: :de) # => "fuenf-autos"
|
289
|
-
|
290
|
-
*Kaan Ozkan*, *Sharang Dashputre*
|
230
|
+
Time.at(1498099140).in_time_zone.inspect
|
231
|
+
# => "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
|
232
|
+
Time.at(1498099140, 123456780, :nsec).in_time_zone.inspect
|
233
|
+
# => "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
|
234
|
+
Time.at(1498099140 + Rational("1/3")).in_time_zone.inspect
|
235
|
+
# => "Thu, 22 Jun 2017 02:39:00 UTC +00:00"
|
291
236
|
|
292
|
-
|
293
|
-
|
294
|
-
[ 1, 2, 3, 4, 5 ].excluding([4, 5]) # => [ 1, 2, 3 ]
|
295
|
-
|
296
|
-
*DHH*
|
297
|
-
|
298
|
-
* Renamed `Array#without` and `Enumerable#without` to `Array#excluding` and `Enumerable#excluding`, to create parity with
|
299
|
-
`Array#including` and `Enumerable#including`. Retained the old names as aliases.
|
300
|
-
|
301
|
-
*DHH*
|
302
|
-
|
303
|
-
* Added `Array#including` and `Enumerable#including` to conveniently enlarge a collection with more members using a method rather than an operator:
|
304
|
-
|
305
|
-
[ 1, 2, 3 ].including(4, 5) # => [ 1, 2, 3, 4, 5 ]
|
306
|
-
post.authors.including(Current.person) # => All the authors plus the current person!
|
307
|
-
|
308
|
-
*DHH*
|
309
|
-
|
310
|
-
|
311
|
-
## Rails 6.0.0.beta3 (March 11, 2019) ##
|
312
|
-
|
313
|
-
* No changes.
|
314
|
-
|
315
|
-
|
316
|
-
## Rails 6.0.0.beta2 (February 25, 2019) ##
|
317
|
-
|
318
|
-
* New autoloading based on [Zeitwerk](https://github.com/fxn/zeitwerk).
|
319
|
-
|
320
|
-
*Xavier Noria*
|
321
|
-
|
322
|
-
* Revise `ActiveSupport::Notifications.unsubscribe` to correctly handle Regex or other multiple-pattern subscribers.
|
323
|
-
|
324
|
-
*Zach Kemp*
|
325
|
-
|
326
|
-
* Add `before_reset` callback to `CurrentAttributes` and define `after_reset` as an alias of `resets` for symmetry.
|
327
|
-
|
328
|
-
*Rosa Gutierrez*
|
329
|
-
|
330
|
-
* Remove the `` Kernel#` `` override that suppresses ENOENT and accidentally returns nil on Unix systems.
|
331
|
-
|
332
|
-
*Akinori Musha*
|
333
|
-
|
334
|
-
* Add `ActiveSupport::HashWithIndifferentAccess#assoc`.
|
335
|
-
|
336
|
-
`assoc` can now be called with either a string or a symbol.
|
237
|
+
After:
|
337
238
|
|
338
|
-
|
239
|
+
Time.at(1498099140).in_time_zone.inspect
|
240
|
+
# => "Thu, 22 Jun 2017 02:39:00.000000000 UTC +00:00"
|
241
|
+
Time.at(1498099140, 123456780, :nsec).in_time_zone.inspect
|
242
|
+
# => "Thu, 22 Jun 2017 02:39:00.123456780 UTC +00:00"
|
243
|
+
Time.at(1498099140 + Rational("1/3")).in_time_zone.inspect
|
244
|
+
# => "Thu, 22 Jun 2017 02:39:00.333333333 UTC +00:00"
|
339
245
|
|
340
|
-
*
|
246
|
+
*akinomaeni*
|
341
247
|
|
342
|
-
|
248
|
+
* Calling `ActiveSupport::TaggedLogging#tagged` without a block now returns a tagged logger.
|
343
249
|
|
250
|
+
```ruby
|
251
|
+
logger.tagged("BCX").info("Funky time!") # => [BCX] Funky time!
|
252
|
+
```
|
344
253
|
|
345
|
-
|
254
|
+
*Eugene Kenny*
|
346
255
|
|
347
|
-
*
|
256
|
+
* Align `Range#cover?` extension behavior with Ruby behavior for backwards ranges.
|
348
257
|
|
349
|
-
|
258
|
+
`(1..10).cover?(5..3)` now returns `false`, as it does in plain Ruby.
|
350
259
|
|
351
|
-
|
260
|
+
Also update `#include?` and `#===` behavior to match.
|
352
261
|
|
353
|
-
*
|
354
|
-
|
355
|
-
* Fix `String#safe_constantize` throwing a `LoadError` for incorrectly cased constant references.
|
262
|
+
*Michael Groeneman*
|
356
263
|
|
357
|
-
|
264
|
+
* Update to TZInfo v2.0.0.
|
358
265
|
|
359
|
-
|
266
|
+
This changes the output of `ActiveSupport::TimeZone.utc_to_local`, but
|
267
|
+
can be controlled with the
|
268
|
+
`ActiveSupport.utc_to_local_returns_utc_offset_times` config.
|
360
269
|
|
361
|
-
|
270
|
+
New Rails 6.1 apps have it enabled by default, existing apps can upgrade
|
271
|
+
via the config in config/initializers/new_framework_defaults_6_1.rb
|
362
272
|
|
363
|
-
|
273
|
+
See the `utc_to_local_returns_utc_offset_times` documentation for details.
|
364
274
|
|
365
|
-
*
|
275
|
+
*Phil Ross*, *Jared Beck*
|
366
276
|
|
367
|
-
|
277
|
+
* Add Date and Time `#yesterday?` and `#tomorrow?` alongside `#today?`.
|
368
278
|
|
369
|
-
|
370
|
-
would not act as alias for `#symbolize_keys`.
|
279
|
+
Aliased to `#prev_day?` and `#next_day?` to match the existing `#prev/next_day` methods.
|
371
280
|
|
372
|
-
*
|
281
|
+
*Jatin Dhankhar*
|
373
282
|
|
374
|
-
*
|
283
|
+
* Add `Enumerable#pick` to complement `ActiveRecord::Relation#pick`.
|
375
284
|
|
376
|
-
*
|
285
|
+
*Eugene Kenny*
|
377
286
|
|
378
|
-
*
|
379
|
-
in favor of `array.flatten.pack("U*")` and `string.scan(/\X/).map(&:codepoints)`, respectively.
|
287
|
+
* [Breaking change] `ActiveSupport::Callbacks#halted_callback_hook` now receive a 2nd argument:
|
380
288
|
|
381
|
-
|
289
|
+
`ActiveSupport::Callbacks#halted_callback_hook` now receive the name of the callback
|
290
|
+
being halted as second argument.
|
291
|
+
This change will allow you to differentiate which callbacks halted the chain
|
292
|
+
and act accordingly.
|
382
293
|
|
383
|
-
|
294
|
+
```ruby
|
295
|
+
class Book < ApplicationRecord
|
296
|
+
before_save { throw(:abort) }
|
297
|
+
before_create { throw(:abort) }
|
384
298
|
|
385
|
-
|
299
|
+
def halted_callback_hook(filter, callback_name)
|
300
|
+
Rails.logger.info("Book couldn't be #{callback_name}d")
|
301
|
+
end
|
386
302
|
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
time += 0.51.seconds
|
303
|
+
Book.create # => "Book couldn't be created"
|
304
|
+
book.save # => "Book couldn't be saved"
|
305
|
+
end
|
391
306
|
```
|
392
|
-
Will now correctly add 0.51 second and not 1 full second.
|
393
307
|
|
394
308
|
*Edouard Chin*
|
395
309
|
|
396
|
-
*
|
397
|
-
in favor of `String#unicode_normalize`
|
398
|
-
|
399
|
-
*Francesco Rodríguez*
|
400
|
-
|
401
|
-
* Deprecate `ActiveSupport::Multibyte::Unicode#downcase/upcase/swapcase` in favor of
|
402
|
-
`String#downcase/upcase/swapcase`.
|
403
|
-
|
404
|
-
*Francesco Rodríguez*
|
405
|
-
|
406
|
-
* Add `ActiveSupport::ParameterFilter`.
|
407
|
-
|
408
|
-
*Yoshiyuki Kinjo*
|
409
|
-
|
410
|
-
* Rename `Module#parent`, `Module#parents`, and `Module#parent_name` to
|
411
|
-
`module_parent`, `module_parents`, and `module_parent_name`.
|
412
|
-
|
413
|
-
*Gannon McGibbon*
|
414
|
-
|
415
|
-
* Deprecate the use of `LoggerSilence` in favor of `ActiveSupport::LoggerSilence`
|
416
|
-
|
417
|
-
*Edouard Chin*
|
418
|
-
|
419
|
-
* Deprecate using negative limits in `String#first` and `String#last`.
|
420
|
-
|
421
|
-
*Gannon McGibbon*, *Eric Turner*
|
310
|
+
* Support `prepend` with `ActiveSupport::Concern`.
|
422
311
|
|
423
|
-
|
424
|
-
with symbol arguments
|
312
|
+
Allows a module with `extend ActiveSupport::Concern` to be prepended.
|
425
313
|
|
426
|
-
|
314
|
+
module Imposter
|
315
|
+
extend ActiveSupport::Concern
|
427
316
|
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
* Changed `ActiveSupport::TaggedLogging.new` to return a new logger instance instead
|
434
|
-
of mutating the one received as parameter.
|
435
|
-
|
436
|
-
*Thierry Joyal*
|
437
|
-
|
438
|
-
* Define `unfreeze_time` as an alias of `travel_back` in `ActiveSupport::Testing::TimeHelpers`.
|
317
|
+
# Same as `included`, except only run when prepended.
|
318
|
+
prepended do
|
319
|
+
end
|
320
|
+
end
|
439
321
|
|
440
|
-
|
322
|
+
class Person
|
323
|
+
prepend Imposter
|
324
|
+
end
|
441
325
|
|
442
|
-
|
326
|
+
Class methods are prepended to the base class, concerning is also
|
327
|
+
updated: `concerning :Imposter, prepend: true do`.
|
443
328
|
|
444
|
-
*
|
329
|
+
*Jason Karns*, *Elia Schito*
|
445
330
|
|
446
|
-
|
447
|
-
|
331
|
+
* Deprecate using `Range#include?` method to check the inclusion of a value
|
332
|
+
in a date time range. It is recommended to use `Range#cover?` method
|
333
|
+
instead of `Range#include?` to check the inclusion of a value
|
334
|
+
in a date time range.
|
448
335
|
|
449
|
-
|
336
|
+
*Vishal Telangre*
|
450
337
|
|
451
|
-
|
338
|
+
* Support added for a `round_mode` parameter, in all number helpers. (See: `BigDecimal::mode`.)
|
452
339
|
|
453
|
-
|
340
|
+
```ruby
|
341
|
+
number_to_currency(1234567890.50, precision: 0, round_mode: :half_down) # => "$1,234,567,890"
|
342
|
+
number_to_percentage(302.24398923423, precision: 5, round_mode: :down) # => "302.24398%"
|
343
|
+
number_to_rounded(389.32314, precision: 0, round_mode: :ceil) # => "390"
|
344
|
+
number_to_human_size(483989, precision: 2, round_mode: :up) # => "480 KB"
|
345
|
+
number_to_human(489939, precision: 2, round_mode: :floor) # => "480 Thousand"
|
454
346
|
|
455
|
-
|
456
|
-
|
347
|
+
485000.to_s(:human, precision: 2, round_mode: :half_even) # => "480 Thousand"
|
348
|
+
```
|
457
349
|
|
458
|
-
*
|
350
|
+
*Tom Lord*
|
459
351
|
|
460
|
-
*
|
352
|
+
* `Array#to_sentence` no longer returns a frozen string.
|
461
353
|
|
462
|
-
|
463
|
-
If no block is given, an Enumerator is returned instead.
|
354
|
+
Before:
|
464
355
|
|
465
|
-
|
466
|
-
|
467
|
-
numbers # => [0, 2, 4, 6, 8]
|
356
|
+
['one', 'two'].to_sentence.frozen?
|
357
|
+
# => true
|
468
358
|
|
469
|
-
|
359
|
+
After:
|
470
360
|
|
471
|
-
|
361
|
+
['one', 'two'].to_sentence.frozen?
|
362
|
+
# => false
|
472
363
|
|
473
|
-
|
474
|
-
cache.exist?('bar') # => false
|
364
|
+
*Nicolas Dular*
|
475
365
|
|
476
|
-
|
366
|
+
* When an instance of `ActiveSupport::Duration` is converted to an `iso8601` duration string, if `weeks` are mixed with `date` parts, the `week` part will be converted to days.
|
367
|
+
This keeps the parser and serializer on the same page.
|
477
368
|
|
478
|
-
|
479
|
-
|
480
|
-
|
369
|
+
```ruby
|
370
|
+
duration = ActiveSupport::Duration.build(1000000)
|
371
|
+
# 1 week, 4 days, 13 hours, 46 minutes, and 40.0 seconds
|
481
372
|
|
482
|
-
|
483
|
-
|
484
|
-
end
|
373
|
+
duration_iso = duration.iso8601
|
374
|
+
# P11DT13H46M40S
|
485
375
|
|
486
|
-
|
487
|
-
|
488
|
-
end
|
376
|
+
ActiveSupport::Duration.parse(duration_iso)
|
377
|
+
# 11 days, 13 hours, 46 minutes, and 40 seconds
|
489
378
|
|
490
|
-
|
379
|
+
duration = ActiveSupport::Duration.build(604800)
|
380
|
+
# 1 week
|
491
381
|
|
492
|
-
|
493
|
-
|
494
|
-
end users are no longer required to make their own:
|
382
|
+
duration_iso = duration.iso8601
|
383
|
+
# P1W
|
495
384
|
|
496
|
-
|
497
|
-
|
498
|
-
|
385
|
+
ActiveSupport::Duration.parse(duration_iso)
|
386
|
+
# 1 week
|
387
|
+
```
|
499
388
|
|
500
|
-
|
501
|
-
sleep 1
|
502
|
-
end
|
389
|
+
*Abhishek Sarkar*
|
503
390
|
|
504
|
-
|
505
|
-
p @event.cpu_time # => 0.256
|
506
|
-
p @event.idle_time # => 1003.2399
|
391
|
+
* Add block support to `ActiveSupport::Testing::TimeHelpers#travel_back`.
|
507
392
|
|
508
|
-
|
393
|
+
*Tim Masliuchenko*
|
509
394
|
|
510
|
-
|
395
|
+
* Update `ActiveSupport::Messages::Metadata#fresh?` to work for cookies with expiry set when
|
396
|
+
`ActiveSupport.parse_json_times = true`.
|
511
397
|
|
512
|
-
*
|
398
|
+
*Christian Gregg*
|
513
399
|
|
514
|
-
|
400
|
+
* Support symbolic links for `content_path` in `ActiveSupport::EncryptedFile`.
|
515
401
|
|
516
|
-
*
|
402
|
+
*Takumi Shotoku*
|
517
403
|
|
518
|
-
|
404
|
+
* Improve `Range#===`, `Range#include?`, and `Range#cover?` to work with beginless (startless)
|
405
|
+
and endless range targets.
|
519
406
|
|
520
|
-
|
407
|
+
*Allen Hsu*, *Andrew Hodgkinson*
|
521
408
|
|
522
|
-
|
409
|
+
* Don't use `Process#clock_gettime(CLOCK_THREAD_CPUTIME_ID)` on Solaris.
|
523
410
|
|
524
|
-
*
|
411
|
+
*Iain Beeston*
|
525
412
|
|
526
|
-
*
|
413
|
+
* Prevent `ActiveSupport::Duration.build(value)` from creating instances of
|
414
|
+
`ActiveSupport::Duration` unless `value` is of type `Numeric`.
|
527
415
|
|
528
|
-
|
529
|
-
`
|
530
|
-
|
416
|
+
Addresses the errant set of behaviours described in #37012 where
|
417
|
+
`ActiveSupport::Duration` comparisons would fail confusingly
|
418
|
+
or return unexpected results when comparing durations built from instances of `String`.
|
531
419
|
|
532
|
-
|
533
|
-
*Use `require "active_support/core_ext/range/compare_range"` instead.*
|
420
|
+
Before:
|
534
421
|
|
535
|
-
|
422
|
+
small_duration_from_string = ActiveSupport::Duration.build('9')
|
423
|
+
large_duration_from_string = ActiveSupport::Duration.build('100000000000000')
|
424
|
+
small_duration_from_int = ActiveSupport::Duration.build(9)
|
536
425
|
|
537
|
-
|
426
|
+
large_duration_from_string > small_duration_from_string
|
427
|
+
# => false
|
538
428
|
|
539
|
-
|
540
|
-
|
429
|
+
small_duration_from_string == small_duration_from_int
|
430
|
+
# => false
|
541
431
|
|
542
|
-
|
543
|
-
# =>
|
432
|
+
small_duration_from_int < large_duration_from_string
|
433
|
+
# => ArgumentError (comparison of ActiveSupport::Duration::Scalar with ActiveSupport::Duration failed)
|
544
434
|
|
545
|
-
|
546
|
-
# =>
|
435
|
+
large_duration_from_string > small_duration_from_int
|
436
|
+
# => ArgumentError (comparison of String with ActiveSupport::Duration failed)
|
547
437
|
|
548
|
-
|
438
|
+
After:
|
549
439
|
|
550
|
-
|
440
|
+
small_duration_from_string = ActiveSupport::Duration.build('9')
|
441
|
+
# => TypeError (can't build an ActiveSupport::Duration from a String)
|
551
442
|
|
552
|
-
*
|
553
|
-
any timezone defined in `ActiveSupport::TimeZone::MAPPING` is missing.
|
443
|
+
*Alexei Emam*
|
554
444
|
|
555
|
-
|
445
|
+
* Add `ActiveSupport::Cache::Store#delete_multi` method to delete multiple keys from the cache store.
|
556
446
|
|
557
|
-
*
|
558
|
-
(Switches from evaled Lua to a batched SCAN + DEL loop.)
|
447
|
+
*Peter Zhu*
|
559
448
|
|
560
|
-
|
449
|
+
* Support multiple arguments in `HashWithIndifferentAccess` for `merge` and `update` methods, to
|
450
|
+
follow Ruby 2.6 addition.
|
561
451
|
|
562
|
-
*
|
563
|
-
size when compression is enabled (which is true by default). This patch
|
564
|
-
does not attempt to repair existing data: please manually flush the cache
|
565
|
-
to clear out the problematic entries.
|
452
|
+
*Wojciech Wnętrzak*
|
566
453
|
|
567
|
-
|
454
|
+
* Allow initializing `thread_mattr_*` attributes via `:default` option.
|
568
455
|
|
569
|
-
|
456
|
+
class Scraper
|
457
|
+
thread_mattr_reader :client, default: Api::Client.new
|
458
|
+
end
|
570
459
|
|
571
|
-
|
572
|
-
URI.unescape("%E3%83%90") # => "バ"
|
573
|
-
URI.unescape("\xe3\x83\x90%E3%83%90") # => Encoding::CompatibilityError
|
460
|
+
*Guilherme Mansur*
|
574
461
|
|
575
|
-
|
462
|
+
* Add `compact_blank` for those times when you want to remove #blank? values from
|
463
|
+
an Enumerable (also `compact_blank!` on Hash, Array, ActionController::Parameters).
|
576
464
|
|
577
|
-
*
|
578
|
-
`Time`, and `TimeWithZone`.
|
465
|
+
*Dana Sherson*
|
579
466
|
|
580
|
-
|
467
|
+
* Make ActiveSupport::Logger Fiber-safe.
|
581
468
|
|
582
|
-
|
583
|
-
|
469
|
+
Use `Fiber.current.__id__` in `ActiveSupport::Logger#local_level=` in order
|
470
|
+
to make log level local to Ruby Fibers in addition to Threads.
|
584
471
|
|
585
|
-
|
472
|
+
Example:
|
586
473
|
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
nth: {
|
591
|
-
ordinals: lambda do |_key, number:, **_options|
|
592
|
-
if number.to_i.abs == 1
|
593
|
-
'er'
|
594
|
-
else
|
595
|
-
'e'
|
596
|
-
end
|
597
|
-
end,
|
474
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
475
|
+
logger.level = 1
|
476
|
+
puts "Main is debug? #{logger.debug?}"
|
598
477
|
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
}
|
604
|
-
}
|
605
|
-
}
|
478
|
+
Fiber.new {
|
479
|
+
logger.local_level = 0
|
480
|
+
puts "Thread is debug? #{logger.debug?}"
|
481
|
+
}.resume
|
606
482
|
|
483
|
+
puts "Main is debug? #{logger.debug?}"
|
607
484
|
|
608
|
-
|
485
|
+
Before:
|
609
486
|
|
610
|
-
|
611
|
-
|
487
|
+
Main is debug? false
|
488
|
+
Thread is debug? true
|
489
|
+
Main is debug? true
|
612
490
|
|
613
|
-
|
614
|
-
has_one :profile
|
615
|
-
delegate :date_of_birth, to: :profile, private: true
|
491
|
+
After:
|
616
492
|
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
end
|
493
|
+
Main is debug? false
|
494
|
+
Thread is debug? true
|
495
|
+
Main is debug? false
|
621
496
|
|
622
|
-
|
623
|
-
# User.new.date_of_birth
|
624
|
-
# => NoMethodError: private method `date_of_birth' called for #<User:0x00000008221340>
|
497
|
+
Fixes #36752.
|
625
498
|
|
626
|
-
*
|
499
|
+
*Alexander Varnin*
|
627
500
|
|
628
|
-
* `
|
629
|
-
|
501
|
+
* Allow the `on_rotation` proc used when decrypting/verifying a message to be
|
502
|
+
passed at the constructor level.
|
630
503
|
|
631
|
-
|
504
|
+
Before:
|
632
505
|
|
633
|
-
|
506
|
+
crypt = ActiveSupport::MessageEncryptor.new('long_secret')
|
507
|
+
crypt.decrypt_and_verify(encrypted_message, on_rotation: proc { ... })
|
508
|
+
crypt.decrypt_and_verify(another_encrypted_message, on_rotation: proc { ... })
|
634
509
|
|
635
|
-
|
510
|
+
After:
|
636
511
|
|
637
|
-
|
512
|
+
crypt = ActiveSupport::MessageEncryptor.new('long_secret', on_rotation: proc { ... })
|
513
|
+
crypt.decrypt_and_verify(encrypted_message)
|
514
|
+
crypt.decrypt_and_verify(another_encrypted_message)
|
638
515
|
|
639
|
-
|
516
|
+
*Edouard Chin*
|
640
517
|
|
641
|
-
|
642
|
-
|
643
|
-
|
518
|
+
* `delegate_missing_to` would raise a `DelegationError` if the object
|
519
|
+
delegated to was `nil`. Now the `allow_nil` option has been added to enable
|
520
|
+
the user to specify they want `nil` returned in this case.
|
644
521
|
|
645
|
-
|
522
|
+
*Matthew Tanous*
|
646
523
|
|
647
|
-
|
524
|
+
* `truncate` would return the original string if it was too short to be truncated
|
525
|
+
and a frozen string if it were long enough to be truncated. Now truncate will
|
526
|
+
consistently return an unfrozen string regardless. This behavior is consistent
|
527
|
+
with `gsub` and `strip`.
|
648
528
|
|
649
|
-
|
529
|
+
Before:
|
650
530
|
|
651
|
-
|
531
|
+
'foobar'.truncate(5).frozen?
|
532
|
+
# => true
|
533
|
+
'foobar'.truncate(6).frozen?
|
534
|
+
# => false
|
652
535
|
|
653
|
-
|
536
|
+
After:
|
654
537
|
|
655
|
-
|
538
|
+
'foobar'.truncate(5).frozen?
|
539
|
+
# => false
|
540
|
+
'foobar'.truncate(6).frozen?
|
541
|
+
# => false
|
656
542
|
|
657
|
-
*
|
543
|
+
*Jordan Thomas*
|
658
544
|
|
659
545
|
|
660
|
-
Please check [
|
546
|
+
Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/activesupport/CHANGELOG.md) for previous changes.
|