activesupport 4.0.13 → 4.1.0.beta1
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 +283 -508
- data/README.rdoc +1 -1
- data/lib/active_support.rb +7 -1
- data/lib/active_support/backtrace_cleaner.rb +5 -5
- data/lib/active_support/benchmarkable.rb +0 -10
- data/lib/active_support/cache.rb +62 -26
- data/lib/active_support/cache/file_store.rb +27 -22
- data/lib/active_support/cache/mem_cache_store.rb +2 -2
- data/lib/active_support/cache/memory_store.rb +1 -0
- data/lib/active_support/cache/strategy/local_cache.rb +3 -0
- data/lib/active_support/callbacks.rb +416 -245
- data/lib/active_support/concern.rb +13 -5
- data/lib/active_support/core_ext.rb +0 -1
- data/lib/active_support/core_ext/array.rb +0 -1
- data/lib/active_support/core_ext/array/access.rb +2 -0
- data/lib/active_support/core_ext/array/conversions.rb +2 -17
- data/lib/active_support/core_ext/array/grouping.rb +24 -12
- data/lib/active_support/core_ext/array/prepend_and_append.rb +2 -2
- data/lib/active_support/core_ext/class.rb +0 -1
- data/lib/active_support/core_ext/class/attribute.rb +1 -2
- data/lib/active_support/core_ext/class/attribute_accessors.rb +5 -169
- data/lib/active_support/core_ext/date/calculations.rb +10 -0
- data/lib/active_support/core_ext/date/conversions.rb +5 -6
- data/lib/active_support/core_ext/date/zones.rb +2 -33
- data/lib/active_support/core_ext/date_and_time/calculations.rb +30 -11
- data/lib/active_support/core_ext/date_and_time/zones.rb +41 -0
- data/lib/active_support/core_ext/date_time/calculations.rb +12 -25
- data/lib/active_support/core_ext/date_time/conversions.rb +2 -0
- data/lib/active_support/core_ext/date_time/zones.rb +3 -21
- data/lib/active_support/core_ext/hash.rb +0 -1
- data/lib/active_support/core_ext/hash/conversions.rb +6 -3
- data/lib/active_support/core_ext/hash/deep_merge.rb +11 -22
- data/lib/active_support/core_ext/hash/indifferent_access.rb +1 -0
- data/lib/active_support/core_ext/hash/keys.rb +27 -47
- data/lib/active_support/core_ext/kernel/reporting.rb +2 -6
- data/lib/active_support/core_ext/module.rb +1 -0
- data/lib/active_support/core_ext/module/attribute_accessors.rb +160 -14
- data/lib/active_support/core_ext/module/concerning.rb +135 -0
- data/lib/active_support/core_ext/module/delegation.rb +14 -4
- data/lib/active_support/core_ext/module/deprecation.rb +0 -2
- data/lib/active_support/core_ext/module/introspection.rb +0 -16
- data/lib/active_support/core_ext/module/method_transplanting.rb +11 -0
- data/lib/active_support/core_ext/numeric/time.rb +8 -0
- data/lib/active_support/core_ext/object.rb +1 -1
- data/lib/active_support/core_ext/object/blank.rb +1 -1
- data/lib/active_support/core_ext/object/deep_dup.rb +6 -6
- data/lib/active_support/core_ext/object/inclusion.rb +4 -15
- data/lib/active_support/core_ext/object/json.rb +197 -0
- data/lib/active_support/core_ext/object/to_json.rb +4 -26
- data/lib/active_support/core_ext/object/to_param.rb +58 -1
- data/lib/active_support/core_ext/object/to_query.rb +7 -56
- data/lib/active_support/core_ext/object/try.rb +1 -1
- data/lib/active_support/core_ext/range/each.rb +2 -1
- data/lib/active_support/core_ext/string/access.rb +31 -31
- data/lib/active_support/core_ext/string/conversions.rb +9 -8
- data/lib/active_support/core_ext/string/exclude.rb +3 -3
- data/lib/active_support/core_ext/string/filters.rb +14 -4
- data/lib/active_support/core_ext/string/inflections.rb +11 -9
- data/lib/active_support/core_ext/string/output_safety.rb +65 -24
- data/lib/active_support/core_ext/string/zones.rb +1 -0
- data/lib/active_support/core_ext/thread.rb +4 -4
- data/lib/active_support/core_ext/time/calculations.rb +10 -57
- data/lib/active_support/core_ext/time/conversions.rb +3 -1
- data/lib/active_support/core_ext/time/zones.rb +2 -21
- data/lib/active_support/dependencies.rb +29 -13
- data/lib/active_support/deprecation.rb +4 -4
- data/lib/active_support/deprecation/behaviors.rb +3 -3
- data/lib/active_support/duration.rb +5 -7
- data/lib/active_support/file_update_checker.rb +1 -1
- data/lib/active_support/hash_with_indifferent_access.rb +4 -9
- data/lib/active_support/i18n.rb +4 -4
- data/lib/active_support/i18n_railtie.rb +2 -6
- data/lib/active_support/inflections.rb +0 -1
- data/lib/active_support/inflector/inflections.rb +17 -17
- data/lib/active_support/inflector/methods.rb +34 -17
- data/lib/active_support/json/decoding.rb +14 -21
- data/lib/active_support/json/encoding.rb +113 -285
- data/lib/active_support/key_generator.rb +1 -1
- data/lib/active_support/lazy_load_hooks.rb +1 -1
- data/lib/active_support/log_subscriber/test_helper.rb +1 -1
- data/lib/active_support/logger.rb +1 -1
- data/lib/active_support/message_encryptor.rb +3 -3
- data/lib/active_support/message_verifier.rb +6 -1
- data/lib/active_support/multibyte/chars.rb +1 -2
- data/lib/active_support/multibyte/unicode.rb +27 -39
- data/lib/active_support/notifications.rb +3 -3
- data/lib/active_support/notifications/instrumenter.rb +2 -1
- data/lib/active_support/number_helper.rb +20 -311
- data/lib/active_support/number_helper/number_converter.rb +182 -0
- data/lib/active_support/number_helper/number_to_currency_converter.rb +46 -0
- data/lib/active_support/number_helper/number_to_delimited_converter.rb +21 -0
- data/lib/active_support/number_helper/number_to_human_converter.rb +66 -0
- data/lib/active_support/number_helper/number_to_human_size_converter.rb +58 -0
- data/lib/active_support/number_helper/number_to_percentage_converter.rb +12 -0
- data/lib/active_support/number_helper/number_to_phone_converter.rb +49 -0
- data/lib/active_support/number_helper/number_to_rounded_converter.rb +62 -0
- data/lib/active_support/option_merger.rb +1 -1
- data/lib/active_support/ordered_hash.rb +0 -8
- data/lib/active_support/ordered_options.rb +8 -0
- data/lib/active_support/per_thread_registry.rb +9 -8
- data/lib/active_support/subscriber.rb +26 -3
- data/lib/active_support/test_case.rb +9 -10
- data/lib/active_support/testing/assertions.rb +0 -30
- data/lib/active_support/testing/autorun.rb +2 -2
- data/lib/active_support/testing/declarative.rb +18 -8
- data/lib/active_support/testing/isolation.rb +13 -65
- data/lib/active_support/testing/setup_and_teardown.rb +17 -2
- data/lib/active_support/testing/tagged_logging.rb +1 -1
- data/lib/active_support/testing/time_helpers.rb +55 -0
- data/lib/active_support/time_with_zone.rb +4 -4
- data/lib/active_support/values/time_zone.rb +18 -15
- data/lib/active_support/version.rb +1 -1
- data/lib/active_support/xml_mini.rb +2 -4
- metadata +71 -61
- data/lib/active_support/basic_object.rb +0 -11
- data/lib/active_support/buffered_logger.rb +0 -21
- data/lib/active_support/core_ext/array/uniq_by.rb +0 -19
- data/lib/active_support/core_ext/hash/diff.rb +0 -14
- data/lib/active_support/core_ext/logger.rb +0 -67
- data/lib/active_support/core_ext/proc.rb +0 -17
- data/lib/active_support/core_ext/string/encoding.rb +0 -8
- data/lib/active_support/json/variable.rb +0 -18
- data/lib/active_support/testing/pending.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c86a26bc9a8eb06276b14867f0f1a1a9937389e
|
4
|
+
data.tar.gz: 977c1c1c03f25c4d3cbbaf8c7b50d53f48253552
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be2cebd01445b199c661483fc72d2d8c815c24127085dec00d3eb13e053c269642ab130dc7e5b531500d058bef87ac1d8ad3fa1f53b8ab93fd3e0db69f0d3a84
|
7
|
+
data.tar.gz: 2e459bd450265b08c97ca61bae3a696e8ea052d48294b672e945988a6f2d55b124a39a3373c4a7f61c8b2bbaed5bb69993ca889d71767af99c563fb17817c52a
|
data/CHANGELOG.md
CHANGED
@@ -1,95 +1,3 @@
|
|
1
|
-
## Rails 4.0.13 (January 6, 2015) ##
|
2
|
-
|
3
|
-
*No changes*
|
4
|
-
|
5
|
-
|
6
|
-
## Rails 4.0.12 (November 16, 2014) ##
|
7
|
-
|
8
|
-
*No changes*
|
9
|
-
|
10
|
-
|
11
|
-
## Rails 4.0.11.1 (November 19, 2014) ##
|
12
|
-
|
13
|
-
*No changes*
|
14
|
-
|
15
|
-
|
16
|
-
## Rails 4.0.11 (September 11, 2014) ##
|
17
|
-
|
18
|
-
*No changes*
|
19
|
-
|
20
|
-
|
21
|
-
## Rails 4.0.10 (September 11, 2014) ##
|
22
|
-
|
23
|
-
* Fix DateTime comparison with DateTime::Infinity object.
|
24
|
-
|
25
|
-
*Rafael Mendonça França*
|
26
|
-
|
27
|
-
* Make Dependencies pass a name to NameError error.
|
28
|
-
|
29
|
-
*arthurnn*, *Yuki Nishijima*
|
30
|
-
|
31
|
-
|
32
|
-
## Rails 4.0.9 (August 18, 2014) ##
|
33
|
-
|
34
|
-
*No changes*
|
35
|
-
|
36
|
-
|
37
|
-
## Rails 4.0.8 (July 2, 2014) ##
|
38
|
-
|
39
|
-
*No changes*
|
40
|
-
|
41
|
-
|
42
|
-
## Rails 4.0.7 (July 2, 2014) ##
|
43
|
-
|
44
|
-
*No changes*
|
45
|
-
|
46
|
-
|
47
|
-
## Rails 4.0.6 (June 26, 2014) ##
|
48
|
-
|
49
|
-
* `Hash#deep_transform_keys` and `Hash#deep_transform_keys!` now transform hashes
|
50
|
-
in nested arrays. This change also applies to `Hash#deep_stringify_keys`,
|
51
|
-
`Hash#deep_stringify_keys!`, `Hash#deep_symbolize_keys` and
|
52
|
-
`Hash#deep_symbolize_keys!`.
|
53
|
-
|
54
|
-
*OZAWA Sakuro*
|
55
|
-
|
56
|
-
* `HashWithIndifferentAccess` better respects `#to_hash` on objects it's
|
57
|
-
given. In particular `#update`, `#merge`, `#replace` all accept objects
|
58
|
-
which respond to `#to_hash`, even if those objects are not Hashes directly.
|
59
|
-
|
60
|
-
Currently, if `HashWithIndifferentAccess.new` is given a non-Hash (even if
|
61
|
-
it responds to `#to_hash`) that object is treated as the default value,
|
62
|
-
rather than the initial keys and value. Changing that could break existing
|
63
|
-
code, so it will be updated in 4.2.
|
64
|
-
|
65
|
-
*Peter Jaros*
|
66
|
-
|
67
|
-
|
68
|
-
## Rails 4.0.5 (May 6, 2014) ##
|
69
|
-
|
70
|
-
*No changes*
|
71
|
-
|
72
|
-
|
73
|
-
## Rails 4.0.4 (March 14, 2014) ##
|
74
|
-
|
75
|
-
* Fix parsing bugs in `XmlMini`
|
76
|
-
|
77
|
-
Symbols or boolean parsing would raise an error for non string values (e.g.
|
78
|
-
integers). Decimal parsing would fail due to a missing requirement.
|
79
|
-
|
80
|
-
*Birkir A. Barkarson*
|
81
|
-
|
82
|
-
* Re-enable support for iterating over `DateTime` ranges
|
83
|
-
|
84
|
-
Fixes #13667.
|
85
|
-
|
86
|
-
*Prathamesh Sonpatki*
|
87
|
-
|
88
|
-
* Use `remove_possible_method` instead of `remove_method` to avoid
|
89
|
-
a `NameError` to be thrown on FreeBSD with the `Date` object.
|
90
|
-
|
91
|
-
*Rafael Mendonça França*, *Robin Dupret*
|
92
|
-
|
93
1
|
* Default the new `I18n.enforce_available_locales` config to `true`, meaning
|
94
2
|
`I18n` will make sure that all locales passed to it must be declared in the
|
95
3
|
`available_locales` list.
|
@@ -103,598 +11,465 @@
|
|
103
11
|
|
104
12
|
*Carlos Antonio da Silva*, *Yves Senn*
|
105
13
|
|
106
|
-
*
|
14
|
+
* Introduce Module#concerning: a natural, low-ceremony way to separate
|
15
|
+
responsibilities within a class.
|
107
16
|
|
108
|
-
|
17
|
+
Imported from https://github.com/37signals/concerning#readme
|
109
18
|
|
110
|
-
|
19
|
+
class Todo < ActiveRecord::Base
|
20
|
+
concerning :EventTracking do
|
21
|
+
included do
|
22
|
+
has_many :events
|
23
|
+
end
|
111
24
|
|
112
|
-
|
25
|
+
def latest_event
|
26
|
+
...
|
27
|
+
end
|
113
28
|
|
29
|
+
private
|
30
|
+
def some_internal_method
|
31
|
+
...
|
32
|
+
end
|
33
|
+
end
|
114
34
|
|
115
|
-
|
35
|
+
concerning :Trashable do
|
36
|
+
def trashed?
|
37
|
+
...
|
38
|
+
end
|
116
39
|
|
117
|
-
|
40
|
+
def latest_event
|
41
|
+
super some_option: true
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
118
45
|
|
46
|
+
is equivalent to defining these modules inline, extending them into
|
47
|
+
concerns, then mixing them in to the class.
|
119
48
|
|
120
|
-
|
49
|
+
Inline concerns tame "junk drawer" classes that intersperse many unrelated
|
50
|
+
class-level declarations, public instance methods, and private
|
51
|
+
implementation. Coalesce related bits and give them definition.
|
52
|
+
These are a stepping stone toward future growth & refactoring.
|
121
53
|
|
122
|
-
|
54
|
+
When to move on from an inline concern:
|
55
|
+
* Encapsulating state? Extract collaborator object.
|
56
|
+
* Encompassing more public behavior or implementation? Move to separate file.
|
57
|
+
* Sharing behavior among classes? Move to separate file.
|
123
58
|
|
59
|
+
*Jeremy Kemper*
|
124
60
|
|
125
|
-
|
61
|
+
* Fix file descriptor being leaked on each call to `Kernel.silence_stream`.
|
126
62
|
|
127
|
-
*
|
128
|
-
due to significant performance issues.
|
63
|
+
*Mario Visic*
|
129
64
|
|
130
|
-
|
65
|
+
* Added `Date#all_week/month/quarter/year` for generating date ranges.
|
131
66
|
|
132
|
-
*
|
67
|
+
*Dmitriy Meremyanin*
|
133
68
|
|
134
|
-
|
69
|
+
* Add `Time.zone.yesterday` and `Time.zone.tomorrow`. These follow the
|
70
|
+
behavior of Ruby's `Date.yesterday` and `Date.tomorrow` but return localized
|
71
|
+
versions, similar to how `Time.zone.today` has returned a localized version
|
72
|
+
of `Date.today`.
|
135
73
|
|
136
|
-
*
|
137
|
-
autoloaded.
|
74
|
+
*Colin Bartlett*
|
138
75
|
|
139
|
-
|
76
|
+
* Show valid keys when `assert_valid_keys` raises an exception, and show the
|
77
|
+
wrong value as it was entered.
|
140
78
|
|
141
|
-
*
|
142
|
-
line into `config/environments/development.rb`:
|
79
|
+
*Gonzalo Rodríguez-Baltanás Díaz*
|
143
80
|
|
144
|
-
|
81
|
+
* Both `cattr_*` and `mattr_*` method definitions now live in `active_support/core_ext/module/attribute_accessors`.
|
145
82
|
|
146
|
-
|
147
|
-
on
|
83
|
+
Requires to `active_support/core_ext/class/attribute_accessors` are
|
84
|
+
deprecated and will be removed in Ruby on Rails 4.2.
|
148
85
|
|
149
|
-
|
86
|
+
*Genadi Samokovarov*
|
150
87
|
|
151
|
-
|
88
|
+
* Deprecated `Numeric#{ago,until,since,from_now}`, the user is expected to explicitly
|
89
|
+
convert the value into an AS::Duration, i.e. `5.ago` => `5.seconds.ago`
|
152
90
|
|
153
|
-
|
154
|
-
The memory used by a key/entry pair is calculated via `#cached_size`:
|
91
|
+
This will help to catch subtle bugs like:
|
155
92
|
|
156
|
-
def
|
157
|
-
|
93
|
+
def recent?(days = 3)
|
94
|
+
self.created_at >= days.ago
|
158
95
|
end
|
159
96
|
|
160
|
-
The
|
161
|
-
estimation](https://gist.github.com/ssimeonov/6047200) for 64-bit MRI on
|
162
|
-
1.9.3 and 2.0.
|
163
|
-
|
164
|
-
Fixes #11512.
|
165
|
-
|
166
|
-
*Simeon Simeonov*
|
167
|
-
|
168
|
-
* Only raise `Module::DelegationError` if it's the source of the exception.
|
169
|
-
|
170
|
-
Fixes #10559.
|
171
|
-
|
172
|
-
* Add `DateTime#usec` and `DateTime#nsec` so that `ActiveSupport::TimeWithZone` keeps
|
173
|
-
sub-second resolution when wrapping a `DateTime` value.
|
174
|
-
|
175
|
-
Fixes #10855.
|
176
|
-
|
177
|
-
*Andrew White*
|
178
|
-
|
179
|
-
* Make `Time.at_with_coercion` retain the second fraction and return local time.
|
180
|
-
|
181
|
-
Fixes #11350.
|
182
|
-
|
183
|
-
*Neer Friedman*, *Andrew White*
|
184
|
-
|
185
|
-
* Fix return value from `BacktraceCleaner#noise` when the cleaner is configured
|
186
|
-
with multiple silencers.
|
97
|
+
The above code would check if the model is created within the last 3 **seconds**.
|
187
98
|
|
188
|
-
|
99
|
+
In the future, `Numeric#{ago,until,since,from_now}` should be removed completely,
|
100
|
+
or throw some sort of errors to indicate there are no implicit conversion from
|
101
|
+
Numeric to AS::Duration.
|
189
102
|
|
190
|
-
*
|
103
|
+
*Godfrey Chan*
|
191
104
|
|
192
|
-
*
|
193
|
-
`#blame_file!` on Exceptions that do not have the Blamable mixin
|
105
|
+
* Requires JSON gem version 1.7.7 or above due to a security issue in older versions.
|
194
106
|
|
195
|
-
*
|
107
|
+
*Godfrey Chan*
|
196
108
|
|
109
|
+
* Removed the old pure-Ruby JSON encoder and switched to a new encoder based on the built-in JSON
|
110
|
+
gem.
|
197
111
|
|
198
|
-
|
112
|
+
Support for encoding `BigDecimal` as a JSON number, as well as defining custom `encode_json`
|
113
|
+
methods to control the JSON output has been **removed from core**. The new encoder will always
|
114
|
+
encode BigDecimals as `String`s and ignore any custom `encode_json` methods.
|
199
115
|
|
200
|
-
|
116
|
+
The old encoder has been extracted into the `activesupport-json_encoder` gem. Installing that
|
117
|
+
gem will bring back the ability to encode `BigDecimal`s as numbers as well as `encode_json`
|
118
|
+
support.
|
201
119
|
|
202
|
-
|
203
|
-
|
204
|
-
* Allow Date to be compared with Time (like it was possible to compare Time with Date).
|
120
|
+
Setting the related configuration `ActiveSupport.encode_big_decimal_as_string` without the
|
121
|
+
`activesupport-json_encoder` gem installed will raise an error.
|
205
122
|
|
206
|
-
*
|
123
|
+
*Godfrey Chan*
|
207
124
|
|
208
|
-
*
|
125
|
+
* Add `ActiveSupport::Testing::TimeHelpers#travel` and `#travel_to`. These methods change current
|
126
|
+
time to the given time or time difference by stubbing `Time.now` and `Date.today` to return the
|
127
|
+
time or date after the difference calculation, or the time or date that got passed into the
|
128
|
+
method respectively.
|
209
129
|
|
210
|
-
|
130
|
+
Example for `#travel`:
|
211
131
|
|
212
|
-
|
213
|
-
|
214
|
-
|
132
|
+
Time.now # => 2013-11-09 15:34:49 -05:00
|
133
|
+
travel 1.day
|
134
|
+
Time.now # => 2013-11-10 15:34:49 -05:00
|
135
|
+
Date.today # => Sun, 10 Nov 2013
|
215
136
|
|
216
|
-
|
137
|
+
Example for `#travel_to`:
|
217
138
|
|
218
|
-
|
219
|
-
|
220
|
-
|
139
|
+
Time.now # => 2013-11-09 15:34:49 -05:00
|
140
|
+
travel_to Time.new(2004, 11, 24, 01, 04, 44)
|
141
|
+
Time.now # => 2004-11-24 01:04:44 -05:00
|
142
|
+
Date.today # => Wed, 24 Nov 2004
|
221
143
|
|
222
|
-
|
144
|
+
Both of these methods also accept a block, which will return the current time back to its
|
145
|
+
original state at the end of the block:
|
223
146
|
|
224
|
-
|
147
|
+
Time.now # => 2013-11-09 15:34:49 -05:00
|
225
148
|
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
*stopdropandrew*
|
149
|
+
travel 1.day do
|
150
|
+
User.create.created_at # => Sun, 10 Nov 2013 15:34:49 EST -05:00
|
151
|
+
end
|
230
152
|
|
231
|
-
|
232
|
-
|
153
|
+
travel_to Time.new(2004, 11, 24, 01, 04, 44) do
|
154
|
+
User.create.created_at # => Wed, 24 Nov 2004 01:04:44 EST -05:00
|
155
|
+
end
|
233
156
|
|
234
|
-
|
157
|
+
Time.now # => 2013-11-09 15:34:49 -05:00
|
235
158
|
|
236
|
-
|
159
|
+
This module is included in `ActiveSupport::TestCase` automatically.
|
237
160
|
|
238
|
-
*
|
161
|
+
*Prem Sichanugrist*, *DHH*
|
239
162
|
|
240
|
-
*
|
241
|
-
Fixes #2608 #1825 #2395.
|
163
|
+
* Unify `cattr_*` interface: allow to pass a block to `cattr_reader`.
|
242
164
|
|
243
165
|
Example:
|
244
166
|
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
#
|
249
|
-
'address'.singularize # => 'address'
|
250
|
-
|
251
|
-
*Mark McSpadden*
|
252
|
-
|
253
|
-
* Prevent `DateTime#change` from truncating the second fraction, when seconds
|
254
|
-
do not need to be changed.
|
255
|
-
|
256
|
-
*Chris Baynes*
|
257
|
-
|
258
|
-
* Added `ActiveSupport::TimeWithZone#to_r` for `Time#at` compatibility.
|
259
|
-
|
260
|
-
Before this change:
|
261
|
-
|
262
|
-
Time.zone = 'Tokyo'
|
263
|
-
time = Time.zone.now
|
264
|
-
time == Time.at(time) # => false
|
265
|
-
|
266
|
-
After the change:
|
267
|
-
|
268
|
-
Time.zone = 'Tokyo'
|
269
|
-
time = Time.zone.now
|
270
|
-
time == Time.at(time) # => true
|
271
|
-
|
272
|
-
*stopdropandrew*
|
273
|
-
|
274
|
-
* `ActiveSupport::NumberHelper#number_to_human` returns the number unaltered when
|
275
|
-
the given units hash does not contain the needed key, e.g. when the number provided
|
276
|
-
is less than the largest key provided.
|
277
|
-
Fixes #9269.
|
278
|
-
|
279
|
-
Examples:
|
280
|
-
|
281
|
-
number_to_human(123, units: {}) # => 123
|
282
|
-
number_to_human(123, units: { thousand: 'k' }) # => 123
|
283
|
-
|
284
|
-
*Michael Hoffman*
|
285
|
-
|
286
|
-
* Added `beginning_of_minute` support to core ext calculations for `Time` and `DateTime`.
|
287
|
-
|
288
|
-
*Gagan Awhad*
|
289
|
-
|
290
|
-
* Add `:nsec` date format.
|
291
|
-
|
292
|
-
*Jamie Gaskins*
|
293
|
-
|
294
|
-
* `ActiveSupport::Gzip.compress` allows two optional arguments for compression
|
295
|
-
level and strategy.
|
296
|
-
|
297
|
-
*Beyond*
|
298
|
-
|
299
|
-
* Modify `TimeWithZone#as_json` to include 3 decimal places of sub-second accuracy
|
300
|
-
by default, which is optional as per the ISO8601 spec, but extremely useful. Also
|
301
|
-
the default behaviour of `Date#toJSON()` in recent versions of Chrome, Safari and
|
302
|
-
Firefox.
|
303
|
-
|
304
|
-
*James Harton*
|
305
|
-
|
306
|
-
* Improve `String#squish` to handle Unicode whitespace. *Antoine Lyset*
|
307
|
-
|
308
|
-
* Standardise on `to_time` returning an instance of `Time` in the local system timezone
|
309
|
-
across `String`, `Time`, `Date`, `DateTime` and `ActiveSupport::TimeWithZone`.
|
310
|
-
|
311
|
-
*Andrew White*
|
312
|
-
|
313
|
-
* Extract `ActiveSupport::Testing::Performance` into https://github.com/rails/rails-perftest
|
314
|
-
You can add the gem to your `Gemfile` to keep using performance tests.
|
315
|
-
|
316
|
-
gem 'rails-perftest'
|
317
|
-
|
318
|
-
*Yves Senn*
|
167
|
+
class A
|
168
|
+
cattr_reader(:defr) { 'default_reader_value' }
|
169
|
+
end
|
170
|
+
A.defr # => 'default_reader_value'
|
319
171
|
|
320
|
-
*
|
321
|
-
Use `Hash.from_trusted_xml` to parse this XML.
|
172
|
+
*Alexey Chernenkov*
|
322
173
|
|
323
|
-
|
174
|
+
* Improved compatibility with the stdlib JSON gem.
|
324
175
|
|
325
|
-
|
176
|
+
Previously, calling `::JSON.{generate,dump}` sometimes causes unexpected
|
177
|
+
failures such as intridea/multi_json#86.
|
326
178
|
|
327
|
-
|
328
|
-
|
179
|
+
`::JSON.{generate,dump}` now bypasses the ActiveSupport JSON encoder
|
180
|
+
completely and yields the same result with or without ActiveSupport. This
|
181
|
+
means that it will **not** call `as_json` and will ignore any options that
|
182
|
+
the JSON gem does not natively understand. To invoke ActiveSupport's JSON
|
183
|
+
encoder instead, use `obj.to_json(options)` or
|
184
|
+
`ActiveSupport::JSON.encode(obj, options)`.
|
329
185
|
|
330
|
-
*
|
186
|
+
*Godfrey Chan*
|
331
187
|
|
332
|
-
*
|
333
|
-
|
188
|
+
* Fix Active Support `Time#to_json` and `DateTime#to_json` to return 3 decimal
|
189
|
+
places worth of fractional seconds, similar to `TimeWithZone`.
|
334
190
|
|
335
|
-
|
336
|
-
"3rd Feb".to_date => Sun, 03 Feb 2013
|
191
|
+
*Ryan Glover*
|
337
192
|
|
338
|
-
|
193
|
+
* Removed circular reference protection in JSON encoder, deprecated
|
194
|
+
`ActiveSupport::JSON::Encoding::CircularReferenceError`.
|
339
195
|
|
340
|
-
*
|
196
|
+
*Godfrey Chan*, *Sergio Campamá*
|
341
197
|
|
342
|
-
|
198
|
+
* Add `capitalize` option to `Inflector.humanize`, so strings can be humanized without being capitalized:
|
343
199
|
|
344
|
-
|
200
|
+
'employee_salary'.humanize # => "Employee salary"
|
201
|
+
'employee_salary'.humanize(capitalize: false) # => "employee salary"
|
345
202
|
|
346
|
-
*
|
203
|
+
*claudiob*
|
347
204
|
|
348
|
-
|
205
|
+
* Fixed `Object#as_json` and `Struct#as_json` not working properly with options. They now take
|
206
|
+
the same options as `Hash#as_json`:
|
349
207
|
|
350
|
-
|
351
|
-
|
208
|
+
struct = Struct.new(:foo, :bar).new
|
209
|
+
struct.foo = "hello"
|
210
|
+
struct.bar = "world"
|
211
|
+
json = struct.as_json(only: [:foo]) # => {foo: "hello"}
|
352
212
|
|
353
|
-
*
|
213
|
+
*Sergio Campamá*, *Godfrey Chan*
|
354
214
|
|
355
|
-
*
|
215
|
+
* Added `Numeric#in_milliseconds`, like `1.hour.in_milliseconds`, so we can feed them to JavaScript functions like `getTime()`.
|
356
216
|
|
357
217
|
*DHH*
|
358
218
|
|
359
|
-
*
|
360
|
-
The encoding scheme was broken for unicode characters outside the basic multilingual plane;
|
361
|
-
since json is assumed to be UTF-8, and we already force the encoding to UTF-8,
|
362
|
-
simply pass through the un-encoded characters.
|
363
|
-
|
364
|
-
*Brett Carter*
|
365
|
-
|
366
|
-
* Deprecate `Time.time_with_date_fallback`, `Time.utc_time` and `Time.local_time`.
|
367
|
-
These methods were added to handle the limited range of Ruby's native `Time`
|
368
|
-
implementation. Those limitations no longer apply so we are deprecating them in 4.0
|
369
|
-
and they will be removed in 4.1.
|
370
|
-
|
371
|
-
*Andrew White*
|
372
|
-
|
373
|
-
* Deprecate `Date#to_time_in_current_zone` and add `Date#in_time_zone`. *Andrew White*
|
219
|
+
* Calling `ActiveSupport::JSON.decode` with unsupported options now raises an error.
|
374
220
|
|
375
|
-
*
|
221
|
+
*Godfrey Chan*
|
376
222
|
|
377
|
-
*
|
378
|
-
This class is used for proxy classes. It avoids confusion with Ruby's `BasicObject`
|
379
|
-
class.
|
223
|
+
* Support `:unless_exist` in `FileStore`.
|
380
224
|
|
381
|
-
*
|
225
|
+
*Michael Grosser*
|
382
226
|
|
383
|
-
*
|
384
|
-
with cache stores that rely on `Marshal` (`MemCacheStore` and `FileStore`).
|
385
|
-
Fixes #8167.
|
386
|
-
|
387
|
-
*Uriel Katz*
|
227
|
+
* Fix `slice!` deleting the default value of the hash.
|
388
228
|
|
389
|
-
*
|
229
|
+
*Antonio Santos*
|
390
230
|
|
391
|
-
*
|
392
|
-
|
393
|
-
times for caches, e.g.:
|
231
|
+
* `require_dependency` accepts objects that respond to `to_path`, in
|
232
|
+
particular `Pathname` instances.
|
394
233
|
|
395
|
-
|
396
|
-
...
|
234
|
+
*Benjamin Fleischer*
|
397
235
|
|
398
|
-
|
236
|
+
* Disable the ability to iterate over Range of AS::TimeWithZone
|
237
|
+
due to significant performance issues.
|
399
238
|
|
400
|
-
*
|
239
|
+
*Bogdan Gusiev*
|
401
240
|
|
402
|
-
*
|
241
|
+
* Allow attaching event subscribers to ActiveSupport::Notifications namespaces
|
242
|
+
before they're defined. Essentially, this means instead of this:
|
403
243
|
|
404
|
-
|
244
|
+
class JokeSubscriber < ActiveSupport::Subscriber
|
245
|
+
def sql(event)
|
246
|
+
puts "A rabbi and a priest walk into a bar..."
|
247
|
+
end
|
405
248
|
|
406
|
-
|
407
|
-
|
249
|
+
# This call needs to happen *after* defining the methods.
|
250
|
+
attach_to "active_record"
|
408
251
|
end
|
409
|
-
Thread.new do
|
410
|
-
XmlMini.with_backend("LibXML") { libxml_power }
|
411
|
-
end
|
412
|
-
|
413
|
-
Each thread will use it's own backend.
|
414
|
-
|
415
|
-
*Nikita Afanasenko*
|
416
|
-
|
417
|
-
* Dependencies no longer trigger `Kernel#autoload` in `remove_constant`. Fixes #8213. *Xavier Noria*
|
418
|
-
|
419
|
-
* Simplify `mocha` integration and remove monkey-patches, bumping `mocha` to 0.13.0. *James Mead*
|
420
|
-
|
421
|
-
* `#as_json` isolates options when encoding a hash. Fixes #8182.
|
422
|
-
|
423
|
-
*Yves Senn*
|
424
252
|
|
425
|
-
|
253
|
+
You can do this:
|
426
254
|
|
427
|
-
|
255
|
+
class JokeSubscriber < ActiveSupport::Subscriber
|
256
|
+
# This is much easier to read!
|
257
|
+
attach_to "active_record"
|
428
258
|
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
* Fixed timezone mapping of the Solomon Islands. *Steve Klabnik*
|
434
|
-
|
435
|
-
* Make callstack attribute optional in `ActiveSupport::Deprecation::Reporting`
|
436
|
-
methods `warn` and `deprecation_warning`.
|
437
|
-
|
438
|
-
*Alexey Gaziev*
|
439
|
-
|
440
|
-
* Implement `HashWithIndifferentAccess#replace` so `key?` works correctly. *David Graham*
|
259
|
+
def sql(event)
|
260
|
+
puts "A rabbi and a priest walk into a bar..."
|
261
|
+
end
|
262
|
+
end
|
441
263
|
|
442
|
-
|
443
|
-
and `chmod` calls.
|
264
|
+
This should make it easier to read and understand these subscribers.
|
444
265
|
|
445
|
-
*
|
266
|
+
*Daniel Schierbeck*
|
446
267
|
|
447
|
-
* `
|
268
|
+
* Add `Date#middle_of_day`, `DateTime#middle_of_day` and `Time#middle_of_day` methods.
|
448
269
|
|
449
|
-
|
270
|
+
Also added `midday`, `noon`, `at_midday`, `at_noon` and `at_middle_of_day` as aliases.
|
450
271
|
|
451
|
-
*
|
272
|
+
*Anatoli Makarevich*
|
452
273
|
|
453
|
-
*
|
454
|
-
`HashWithIndifferentAccess#extract!` returns a `HashWithIndifferentAccess` instance.
|
274
|
+
* Fix ActiveSupport::Cache::FileStore#cleanup to no longer rely on missing each_key method.
|
455
275
|
|
456
|
-
*
|
276
|
+
*Murray Steele*
|
457
277
|
|
458
|
-
*
|
278
|
+
* Ensure that autoloaded constants in all-caps nestings are marked as
|
279
|
+
autoloaded.
|
459
280
|
|
460
|
-
*
|
281
|
+
*Simon Coffey*
|
461
282
|
|
462
|
-
|
463
|
-
|
283
|
+
* Add `String#remove(pattern)` as a short-hand for the common pattern of
|
284
|
+
`String#gsub(pattern, '')`.
|
464
285
|
|
465
|
-
*
|
286
|
+
*DHH*
|
466
287
|
|
467
|
-
*
|
288
|
+
* Adds a new deprecation behaviour that raises an exception. Throwing this
|
289
|
+
line into +config/environments/development.rb+
|
468
290
|
|
469
|
-
|
470
|
-
def before
|
471
|
-
Rails.logger.push_tags :jobs, self.class.name
|
472
|
-
end
|
291
|
+
ActiveSupport::Deprecation.behavior = :raise
|
473
292
|
|
474
|
-
|
475
|
-
|
476
|
-
end
|
477
|
-
end
|
293
|
+
will cause the application to raise an +ActiveSupport::DeprecationException+
|
294
|
+
on deprecations.
|
478
295
|
|
479
|
-
|
296
|
+
Use this for aggressive deprecation cleanups.
|
480
297
|
|
481
|
-
*
|
482
|
-
`self.class` usage:
|
298
|
+
*Xavier Noria*
|
483
299
|
|
484
|
-
|
485
|
-
def self.hello
|
486
|
-
"world"
|
487
|
-
end
|
300
|
+
* Remove 'cow' => 'kine' irregular inflection from default inflections.
|
488
301
|
|
489
|
-
|
490
|
-
end
|
302
|
+
*Andrew White*
|
491
303
|
|
492
|
-
|
304
|
+
* Add `DateTime#to_s(:iso8601)` and `Date#to_s(:iso8601)` for consistency.
|
493
305
|
|
494
|
-
*
|
495
|
-
config option added (default is Monday).
|
306
|
+
*Andrew White*
|
496
307
|
|
497
|
-
|
308
|
+
* Add `Time#to_s(:iso8601)` for easy conversion of times to the iso8601 format for easy Javascript date parsing.
|
498
309
|
|
499
|
-
*
|
310
|
+
*DHH*
|
500
311
|
|
501
|
-
|
502
|
-
|
312
|
+
* Improve `ActiveSupport::Cache::MemoryStore` cache size calculation.
|
313
|
+
The memory used by a key/entry pair is calculated via `#cached_size`:
|
503
314
|
|
504
|
-
|
505
|
-
|
506
|
-
end
|
315
|
+
def cached_size(key, entry)
|
316
|
+
key.to_s.bytesize + entry.size + PER_ENTRY_OVERHEAD
|
507
317
|
end
|
508
318
|
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
* `ActiveSupport::Benchmarkable#silence` has been deprecated due to its lack of
|
514
|
-
thread safety. It will be removed without replacement in Rails 4.1.
|
515
|
-
|
516
|
-
*Steve Klabnik*
|
517
|
-
|
518
|
-
* An optional block can be passed to `Hash#deep_merge`. The block will be invoked
|
519
|
-
for each duplicated key and used to resolve the conflict.
|
520
|
-
|
521
|
-
*Pranas Kiziela*
|
522
|
-
|
523
|
-
* `ActiveSupport::Deprecation` is now a class. It is possible to create an instance
|
524
|
-
of deprecator. Backwards compatibility has been preserved.
|
525
|
-
|
526
|
-
You can choose which instance of the deprecator will be used.
|
527
|
-
|
528
|
-
deprecate :method_name, deprecator: deprecator_instance
|
529
|
-
|
530
|
-
You can use `ActiveSupport::Deprecation` in your gem.
|
531
|
-
|
532
|
-
require 'active_support/deprecation'
|
533
|
-
require 'active_support/core_ext/module/deprecation'
|
319
|
+
The value of `PER_ENTRY_OVERHEAD` is 240 bytes based on an [empirical
|
320
|
+
estimation](https://gist.github.com/ssimeonov/6047200) for 64-bit MRI on
|
321
|
+
1.9.3 and 2.0. GH#11512
|
534
322
|
|
535
|
-
|
536
|
-
def self.deprecator
|
537
|
-
ActiveSupport::Deprecation.new('2.0', 'MyGem')
|
538
|
-
end
|
323
|
+
*Simeon Simeonov*
|
539
324
|
|
540
|
-
|
541
|
-
end
|
325
|
+
* Only raise `Module::DelegationError` if it's the source of the exception.
|
542
326
|
|
543
|
-
|
544
|
-
end
|
327
|
+
Fixes #10559
|
545
328
|
|
546
|
-
|
547
|
-
end
|
329
|
+
*Andrew White*
|
548
330
|
|
549
|
-
|
550
|
-
# => DEPRECATION WARNING: old_method is deprecated and will be removed from MyGem 2.0 (use new_method instead). (called from <main> at file.rb:18)
|
331
|
+
* Make `Time.at_with_coercion` retain the second fraction and return local time.
|
551
332
|
|
552
|
-
|
333
|
+
Fixes #11350
|
553
334
|
|
554
|
-
*
|
335
|
+
*Neer Friedman*, *Andrew White*
|
555
336
|
|
556
|
-
* `
|
557
|
-
|
337
|
+
* Make `HashWithIndifferentAccess#select` always return the hash, even when
|
338
|
+
`Hash#select!` returns `nil`, to allow further chaining.
|
558
339
|
|
559
|
-
|
340
|
+
*Marc Schütz*
|
560
341
|
|
561
|
-
|
562
|
-
def filter(controller)
|
563
|
-
end
|
564
|
-
end
|
342
|
+
* Remove deprecated `String#encoding_aware?` core extensions (`core_ext/string/encoding`).
|
565
343
|
|
566
|
-
|
567
|
-
(`#before`, `#after` or `#around`):
|
344
|
+
*Arun Agrawal*
|
568
345
|
|
569
|
-
|
346
|
+
* Remove deprecated `Module#local_constant_names` in favor of `Module#local_constants`.
|
570
347
|
|
571
|
-
|
572
|
-
def before(controller)
|
573
|
-
end
|
574
|
-
end
|
348
|
+
*Arun Agrawal*
|
575
349
|
|
576
|
-
|
350
|
+
* Remove deprecated `DateTime.local_offset` in favor of `DateTime.civil_from_fromat`.
|
577
351
|
|
578
|
-
*
|
579
|
-
The block will be invoked for each duplicated key, and used to resolve the conflict,
|
580
|
-
thus replicating the behaviour of the corresponding methods on the `Hash` class.
|
352
|
+
*Arun Agrawal*
|
581
353
|
|
582
|
-
|
354
|
+
* Remove deprecated `Logger` core extensions (`core_ext/logger.rb`).
|
583
355
|
|
584
|
-
*
|
585
|
-
The `j` alias is already used for `ActionView::Helpers::JavaScriptHelper#escape_javascript`
|
586
|
-
and both modules are included in the view context that would confuse the developers.
|
356
|
+
*Carlos Antonio da Silva*
|
587
357
|
|
588
|
-
|
358
|
+
* Remove deprecated `Time#time_with_datetime_fallback`, `Time#utc_time`
|
359
|
+
and `Time#local_time` in favor of `Time#utc` and `Time#local`.
|
589
360
|
|
590
|
-
*
|
361
|
+
*Vipul A M*
|
591
362
|
|
592
|
-
|
363
|
+
* Remove deprecated `Hash#diff` with no replacement.
|
593
364
|
|
594
|
-
|
595
|
-
|
365
|
+
If you're using it to compare hashes for the purpose of testing, please use
|
366
|
+
MiniTest's `assert_equal` instead.
|
596
367
|
|
597
368
|
*Carlos Antonio da Silva*
|
598
369
|
|
599
|
-
* `
|
600
|
-
`#encode_json` methods for custom JSON string literals.
|
370
|
+
* Remove deprecated `Date#to_time_in_current_zone` in favor of `Date#in_time_zone`.
|
601
371
|
|
602
|
-
*
|
372
|
+
*Vipul A M*
|
603
373
|
|
604
|
-
*
|
374
|
+
* Remove deprecated `Proc#bind` with no replacement.
|
605
375
|
|
606
|
-
*
|
607
|
-
accept locale as an extra argument.
|
376
|
+
*Carlos Antonio da Silva*
|
608
377
|
|
609
|
-
|
378
|
+
* Remove deprecated `Array#uniq_by` and `Array#uniq_by!`, use native
|
379
|
+
`Array#uniq` and `Array#uniq!` instead.
|
610
380
|
|
611
|
-
*
|
612
|
-
receiving object does not implement the method, but you can still get the
|
613
|
-
old behavior by using the new `Object#try!`.
|
381
|
+
*Carlos Antonio da Silva*
|
614
382
|
|
615
|
-
|
383
|
+
* Remove deprecated `ActiveSupport::BasicObject`, use `ActiveSupport::ProxyObject` instead.
|
616
384
|
|
617
|
-
*
|
385
|
+
*Carlos Antonio da Silva*
|
618
386
|
|
619
|
-
*
|
387
|
+
* Remove deprecated `BufferedLogger`, use `ActiveSupport::Logger` instead.
|
620
388
|
|
621
|
-
*
|
389
|
+
*Yves Senn*
|
622
390
|
|
623
|
-
*
|
391
|
+
* Remove deprecated `assert_present` and `assert_blank` methods, use `assert
|
392
|
+
object.blank?` and `assert object.present?` instead.
|
624
393
|
|
625
|
-
*
|
394
|
+
*Yves Senn*
|
626
395
|
|
627
|
-
*
|
396
|
+
* Fix return value from `BacktraceCleaner#noise` when the cleaner is configured
|
397
|
+
with multiple silencers.
|
628
398
|
|
629
|
-
|
630
|
-
include ActiveSupport::Configurable
|
631
|
-
config_accessor :allowed_access, instance_accessor: false
|
632
|
-
end
|
399
|
+
Fixes #11030
|
633
400
|
|
634
|
-
|
635
|
-
User.new.allowed_access # => NoMethodError
|
401
|
+
*Mark J. Titorenko*
|
636
402
|
|
637
|
-
|
403
|
+
* `HashWithIndifferentAccess#select` now returns a `HashWithIndifferentAccess`
|
404
|
+
instance instead of a `Hash` instance.
|
638
405
|
|
639
|
-
|
640
|
-
`Numeric#to_s`. `Numeric#to_s` now accepts the formatting options `:phone`, `:currency`, `:percentage`, `:delimited`,
|
641
|
-
`:rounded`, `:human`, and `:human_size`.
|
406
|
+
Fixes #10723
|
642
407
|
|
643
|
-
*
|
408
|
+
*Albert Llop*
|
644
409
|
|
645
|
-
* Add `
|
410
|
+
* Add `DateTime#usec` and `DateTime#nsec` so that `ActiveSupport::TimeWithZone` keeps
|
411
|
+
sub-second resolution when wrapping a `DateTime` value.
|
646
412
|
|
647
|
-
|
413
|
+
Fixes #10855
|
648
414
|
|
649
|
-
*
|
415
|
+
*Andrew White*
|
650
416
|
|
651
|
-
* `
|
417
|
+
* Fix `ActiveSupport::Dependencies::Loadable#load_dependency` calling
|
418
|
+
`#blame_file!` on Exceptions that do not have the Blamable mixin
|
652
419
|
|
653
|
-
*
|
420
|
+
*Andrew Kreiling*
|
654
421
|
|
655
|
-
*
|
422
|
+
* Override `Time.at` to support the passing of Time-like values when called with a single argument.
|
656
423
|
|
657
|
-
*
|
424
|
+
*Andrew White*
|
658
425
|
|
659
|
-
*
|
426
|
+
* Prevent side effects to hashes inside arrays when
|
427
|
+
`Hash#with_indifferent_access` is called.
|
660
428
|
|
661
|
-
|
429
|
+
Fixes #10526
|
662
430
|
|
663
|
-
*
|
431
|
+
*Yves Senn*
|
664
432
|
|
665
|
-
*
|
433
|
+
* Removed deprecated `ActiveSupport::JSON::Variable` with no replacement.
|
666
434
|
|
667
|
-
*
|
435
|
+
*Toshinori Kajihara*
|
668
436
|
|
669
|
-
*
|
437
|
+
* Raise an error when multiple `included` blocks are defined for a Concern.
|
438
|
+
The old behavior would silently discard previously defined blocks, running
|
439
|
+
only the last one.
|
670
440
|
|
671
|
-
*
|
441
|
+
*Mike Dillon*
|
672
442
|
|
673
|
-
*
|
443
|
+
* Replace `multi_json` with `json`.
|
674
444
|
|
675
|
-
|
445
|
+
Since Rails requires Ruby 1.9 and since Ruby 1.9 includes `json` in the standard library,
|
446
|
+
`multi_json` is no longer necessary.
|
676
447
|
|
677
|
-
*
|
448
|
+
*Erik Michaels-Ober*
|
678
449
|
|
679
|
-
*
|
680
|
-
|
450
|
+
* Added escaping of U+2028 and U+2029 inside the json encoder.
|
451
|
+
These characters are legal in JSON but break the Javascript interpreter.
|
452
|
+
After escaping them, the JSON is still legal and can be parsed by Javascript.
|
681
453
|
|
682
|
-
*
|
683
|
-
use `Module#methods` from now on (which returns symbols). *Xavier Noria*
|
454
|
+
*Mario Caropreso + Viktor Kelemen + zackham*
|
684
455
|
|
685
|
-
*
|
686
|
-
|
456
|
+
* Fix skipping object callbacks using metadata fetched via callback chain
|
457
|
+
inspection methods (`_*_callbacks`)
|
687
458
|
|
688
|
-
*
|
689
|
-
from the Ruby standard library.
|
459
|
+
*Sean Walbran*
|
690
460
|
|
691
|
-
|
461
|
+
* Add a `fetch_multi` method to the cache stores. The method provides
|
462
|
+
an easy to use API for fetching multiple values from the cache.
|
692
463
|
|
693
|
-
|
464
|
+
Example:
|
694
465
|
|
695
|
-
|
696
|
-
|
466
|
+
# Calculating scores is expensive, so we only do it for posts
|
467
|
+
# that have been updated. Cache keys are automatically extracted
|
468
|
+
# from objects that define a #cache_key method.
|
469
|
+
scores = Rails.cache.fetch_multi(*posts) do |post|
|
470
|
+
calculate_score(post)
|
471
|
+
end
|
697
472
|
|
698
|
-
*
|
473
|
+
*Daniel Schierbeck*
|
699
474
|
|
700
|
-
Please check [
|
475
|
+
Please check [4-0-stable](https://github.com/rails/rails/blob/4-0-stable/activesupport/CHANGELOG.md) for previous changes.
|