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