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