activesupport 3.1.0 → 5.0.0

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.

Files changed (276) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +798 -0
  3. data/MIT-LICENSE +20 -0
  4. data/README.rdoc +13 -7
  5. data/lib/active_support/array_inquirer.rb +44 -0
  6. data/lib/active_support/backtrace_cleaner.rb +38 -34
  7. data/lib/active_support/benchmarkable.rb +17 -28
  8. data/lib/active_support/cache/file_store.rb +85 -70
  9. data/lib/active_support/cache/mem_cache_store.rb +75 -66
  10. data/lib/active_support/cache/memory_store.rb +31 -23
  11. data/lib/active_support/cache/null_store.rb +41 -0
  12. data/lib/active_support/cache/strategy/local_cache.rb +73 -70
  13. data/lib/active_support/cache/strategy/local_cache_middleware.rb +44 -0
  14. data/lib/active_support/cache.rb +360 -294
  15. data/lib/active_support/callbacks.rb +563 -393
  16. data/lib/active_support/concern.rb +42 -34
  17. data/lib/active_support/concurrency/latch.rb +19 -0
  18. data/lib/active_support/concurrency/share_lock.rb +186 -0
  19. data/lib/active_support/configurable.rb +70 -12
  20. data/lib/active_support/core_ext/array/access.rb +53 -9
  21. data/lib/active_support/core_ext/array/conversions.rb +109 -62
  22. data/lib/active_support/core_ext/array/extract_options.rb +2 -2
  23. data/lib/active_support/core_ext/array/grouping.rb +39 -32
  24. data/lib/active_support/core_ext/array/inquiry.rb +17 -0
  25. data/lib/active_support/core_ext/array/prepend_and_append.rb +7 -0
  26. data/lib/active_support/core_ext/array/wrap.rb +16 -18
  27. data/lib/active_support/core_ext/array.rb +2 -2
  28. data/lib/active_support/core_ext/benchmark.rb +7 -0
  29. data/lib/active_support/core_ext/big_decimal/conversions.rb +8 -36
  30. data/lib/active_support/core_ext/class/attribute.rb +47 -34
  31. data/lib/active_support/core_ext/class/attribute_accessors.rb +4 -79
  32. data/lib/active_support/core_ext/class/subclasses.rb +12 -7
  33. data/lib/active_support/core_ext/class.rb +0 -3
  34. data/lib/active_support/core_ext/date/blank.rb +12 -0
  35. data/lib/active_support/core_ext/date/calculations.rb +57 -167
  36. data/lib/active_support/core_ext/date/conversions.rb +31 -42
  37. data/lib/active_support/core_ext/date/zones.rb +2 -10
  38. data/lib/active_support/core_ext/date.rb +5 -0
  39. data/lib/active_support/core_ext/date_and_time/calculations.rb +335 -0
  40. data/lib/active_support/core_ext/date_and_time/compatibility.rb +18 -0
  41. data/lib/active_support/core_ext/date_and_time/zones.rb +40 -0
  42. data/lib/active_support/core_ext/date_time/acts_like.rb +1 -0
  43. data/lib/active_support/core_ext/date_time/blank.rb +12 -0
  44. data/lib/active_support/core_ext/date_time/calculations.rb +132 -65
  45. data/lib/active_support/core_ext/date_time/compatibility.rb +5 -0
  46. data/lib/active_support/core_ext/date_time/conversions.rb +36 -34
  47. data/lib/active_support/core_ext/date_time.rb +5 -0
  48. data/lib/active_support/core_ext/digest/uuid.rb +51 -0
  49. data/lib/active_support/core_ext/enumerable.rb +81 -74
  50. data/lib/active_support/core_ext/file/atomic.rb +53 -26
  51. data/lib/active_support/core_ext/file.rb +0 -1
  52. data/lib/active_support/core_ext/hash/compact.rb +20 -0
  53. data/lib/active_support/core_ext/hash/conversions.rb +175 -70
  54. data/lib/active_support/core_ext/hash/deep_merge.rb +30 -8
  55. data/lib/active_support/core_ext/hash/except.rb +11 -12
  56. data/lib/active_support/core_ext/hash/indifferent_access.rb +7 -8
  57. data/lib/active_support/core_ext/hash/keys.rb +147 -24
  58. data/lib/active_support/core_ext/hash/reverse_merge.rb +2 -3
  59. data/lib/active_support/core_ext/hash/slice.rb +22 -14
  60. data/lib/active_support/core_ext/hash/transform_values.rb +29 -0
  61. data/lib/active_support/core_ext/hash.rb +2 -2
  62. data/lib/active_support/core_ext/integer/inflections.rb +13 -1
  63. data/lib/active_support/core_ext/integer/multiple.rb +4 -0
  64. data/lib/active_support/core_ext/integer/time.rb +12 -22
  65. data/lib/active_support/core_ext/kernel/agnostics.rb +2 -2
  66. data/lib/active_support/core_ext/kernel/concern.rb +12 -0
  67. data/lib/active_support/core_ext/kernel/debugger.rb +2 -15
  68. data/lib/active_support/core_ext/kernel/reporting.rb +12 -62
  69. data/lib/active_support/core_ext/kernel/singleton_class.rb +0 -7
  70. data/lib/active_support/core_ext/kernel.rb +2 -3
  71. data/lib/active_support/core_ext/load_error.rb +14 -7
  72. data/lib/active_support/core_ext/marshal.rb +22 -0
  73. data/lib/active_support/core_ext/module/aliasing.rb +16 -12
  74. data/lib/active_support/core_ext/module/anonymous.rb +12 -8
  75. data/lib/active_support/core_ext/module/attr_internal.rb +2 -5
  76. data/lib/active_support/core_ext/module/attribute_accessors.rb +165 -13
  77. data/lib/active_support/core_ext/module/attribute_accessors_per_thread.rb +141 -0
  78. data/lib/active_support/core_ext/module/concerning.rb +135 -0
  79. data/lib/active_support/core_ext/module/delegation.rb +141 -68
  80. data/lib/active_support/core_ext/module/deprecation.rb +17 -3
  81. data/lib/active_support/core_ext/module/introspection.rb +9 -31
  82. data/lib/active_support/core_ext/module/method_transplanting.rb +3 -0
  83. data/lib/active_support/core_ext/module/qualified_const.rb +70 -0
  84. data/lib/active_support/core_ext/module/reachable.rb +1 -3
  85. data/lib/active_support/core_ext/module/remove_method.rb +24 -5
  86. data/lib/active_support/core_ext/module.rb +3 -3
  87. data/lib/active_support/core_ext/name_error.rb +15 -2
  88. data/lib/active_support/core_ext/numeric/bytes.rb +20 -0
  89. data/lib/active_support/core_ext/numeric/conversions.rb +145 -0
  90. data/lib/active_support/core_ext/numeric/inquiry.rb +26 -0
  91. data/lib/active_support/core_ext/numeric/time.rb +31 -36
  92. data/lib/active_support/core_ext/numeric.rb +2 -0
  93. data/lib/active_support/core_ext/object/acts_like.rb +4 -4
  94. data/lib/active_support/core_ext/object/blank.rb +52 -18
  95. data/lib/active_support/core_ext/object/deep_dup.rb +53 -0
  96. data/lib/active_support/core_ext/object/duplicable.rb +12 -20
  97. data/lib/active_support/core_ext/object/inclusion.rb +13 -1
  98. data/lib/active_support/core_ext/object/instance_variables.rb +7 -12
  99. data/lib/active_support/core_ext/object/json.rb +205 -0
  100. data/lib/active_support/core_ext/object/to_param.rb +1 -55
  101. data/lib/active_support/core_ext/object/to_query.rb +66 -9
  102. data/lib/active_support/core_ext/object/try.rb +124 -33
  103. data/lib/active_support/core_ext/object/with_options.rb +37 -11
  104. data/lib/active_support/core_ext/object.rb +2 -1
  105. data/lib/active_support/core_ext/range/conversions.rb +17 -7
  106. data/lib/active_support/core_ext/range/each.rb +21 -0
  107. data/lib/active_support/core_ext/range/include_range.rb +20 -18
  108. data/lib/active_support/core_ext/range/overlaps.rb +1 -1
  109. data/lib/active_support/core_ext/range.rb +1 -2
  110. data/lib/active_support/core_ext/securerandom.rb +23 -0
  111. data/lib/active_support/core_ext/string/access.rb +95 -90
  112. data/lib/active_support/core_ext/string/behavior.rb +1 -1
  113. data/lib/active_support/core_ext/string/conversions.rb +41 -38
  114. data/lib/active_support/core_ext/string/exclude.rb +6 -1
  115. data/lib/active_support/core_ext/string/filters.rb +70 -17
  116. data/lib/active_support/core_ext/string/indent.rb +43 -0
  117. data/lib/active_support/core_ext/string/inflections.rb +139 -59
  118. data/lib/active_support/core_ext/string/inquiry.rb +2 -2
  119. data/lib/active_support/core_ext/string/multibyte.rb +46 -65
  120. data/lib/active_support/core_ext/string/output_safety.rb +153 -56
  121. data/lib/active_support/core_ext/string/strip.rb +3 -6
  122. data/lib/active_support/core_ext/string/zones.rb +14 -0
  123. data/lib/active_support/core_ext/string.rb +2 -3
  124. data/lib/active_support/core_ext/struct.rb +3 -0
  125. data/lib/active_support/core_ext/time/calculations.rb +173 -173
  126. data/lib/active_support/core_ext/time/compatibility.rb +5 -0
  127. data/lib/active_support/core_ext/time/conversions.rb +33 -29
  128. data/lib/active_support/core_ext/time/marshal.rb +2 -56
  129. data/lib/active_support/core_ext/time/zones.rb +57 -32
  130. data/lib/active_support/core_ext/time.rb +5 -0
  131. data/lib/active_support/core_ext/uri.rb +13 -19
  132. data/lib/active_support/core_ext.rb +3 -2
  133. data/lib/active_support/dependencies/autoload.rb +47 -20
  134. data/lib/active_support/dependencies/interlock.rb +51 -0
  135. data/lib/active_support/dependencies.rb +315 -265
  136. data/lib/active_support/deprecation/behaviors.rb +71 -30
  137. data/lib/active_support/deprecation/instance_delegator.rb +24 -0
  138. data/lib/active_support/deprecation/method_wrappers.rb +59 -18
  139. data/lib/active_support/deprecation/proxy_wrappers.rb +82 -14
  140. data/lib/active_support/deprecation/reporting.rb +61 -14
  141. data/lib/active_support/deprecation.rb +38 -13
  142. data/lib/active_support/descendants_tracker.rb +34 -19
  143. data/lib/active_support/duration/iso8601_parser.rb +122 -0
  144. data/lib/active_support/duration/iso8601_serializer.rb +51 -0
  145. data/lib/active_support/duration.rb +85 -14
  146. data/lib/active_support/evented_file_update_checker.rb +194 -0
  147. data/lib/active_support/execution_wrapper.rb +117 -0
  148. data/lib/active_support/executor.rb +6 -0
  149. data/lib/active_support/file_update_checker.rb +138 -17
  150. data/lib/active_support/gem_version.rb +15 -0
  151. data/lib/active_support/gzip.rb +11 -5
  152. data/lib/active_support/hash_with_indifferent_access.rb +199 -49
  153. data/lib/active_support/i18n.rb +6 -2
  154. data/lib/active_support/i18n_railtie.rb +40 -21
  155. data/lib/active_support/inflections.rb +22 -13
  156. data/lib/active_support/inflector/inflections.rb +175 -144
  157. data/lib/active_support/inflector/methods.rb +328 -91
  158. data/lib/active_support/inflector/transliterate.rb +51 -37
  159. data/lib/active_support/json/decoding.rb +31 -22
  160. data/lib/active_support/json/encoding.rb +88 -248
  161. data/lib/active_support/key_generator.rb +71 -0
  162. data/lib/active_support/lazy_load_hooks.rb +27 -25
  163. data/lib/active_support/locale/en.yml +102 -3
  164. data/lib/active_support/log_subscriber/test_helper.rb +24 -21
  165. data/lib/active_support/log_subscriber.rb +36 -49
  166. data/lib/active_support/logger.rb +106 -0
  167. data/lib/active_support/logger_silence.rb +28 -0
  168. data/lib/active_support/logger_thread_safe_level.rb +31 -0
  169. data/lib/active_support/message_encryptor.rb +72 -36
  170. data/lib/active_support/message_verifier.rb +96 -24
  171. data/lib/active_support/multibyte/chars.rb +88 -333
  172. data/lib/active_support/multibyte/unicode.rb +156 -136
  173. data/lib/active_support/multibyte.rb +5 -28
  174. data/lib/active_support/notifications/fanout.rb +115 -19
  175. data/lib/active_support/notifications/instrumenter.rb +52 -15
  176. data/lib/active_support/notifications.rb +168 -33
  177. data/lib/active_support/number_helper/number_converter.rb +182 -0
  178. data/lib/active_support/number_helper/number_to_currency_converter.rb +44 -0
  179. data/lib/active_support/number_helper/number_to_delimited_converter.rb +28 -0
  180. data/lib/active_support/number_helper/number_to_human_converter.rb +68 -0
  181. data/lib/active_support/number_helper/number_to_human_size_converter.rb +62 -0
  182. data/lib/active_support/number_helper/number_to_percentage_converter.rb +12 -0
  183. data/lib/active_support/number_helper/number_to_phone_converter.rb +58 -0
  184. data/lib/active_support/number_helper/number_to_rounded_converter.rb +92 -0
  185. data/lib/active_support/number_helper.rb +368 -0
  186. data/lib/active_support/option_merger.rb +1 -1
  187. data/lib/active_support/ordered_hash.rb +18 -183
  188. data/lib/active_support/ordered_options.rb +44 -24
  189. data/lib/active_support/per_thread_registry.rb +58 -0
  190. data/lib/active_support/proxy_object.rb +13 -0
  191. data/lib/active_support/rails.rb +27 -0
  192. data/lib/active_support/railtie.rb +25 -34
  193. data/lib/active_support/reloader.rb +129 -0
  194. data/lib/active_support/rescuable.rb +98 -48
  195. data/lib/active_support/security_utils.rb +27 -0
  196. data/lib/active_support/string_inquirer.rb +14 -9
  197. data/lib/active_support/subscriber.rb +120 -0
  198. data/lib/active_support/tagged_logging.rb +78 -0
  199. data/lib/active_support/test_case.rb +69 -17
  200. data/lib/active_support/testing/assertions.rb +43 -41
  201. data/lib/active_support/testing/autorun.rb +12 -0
  202. data/lib/active_support/testing/constant_lookup.rb +50 -0
  203. data/lib/active_support/testing/declarative.rb +7 -21
  204. data/lib/active_support/testing/deprecation.rb +14 -33
  205. data/lib/active_support/testing/file_fixtures.rb +34 -0
  206. data/lib/active_support/testing/isolation.rb +53 -95
  207. data/lib/active_support/testing/method_call_assertions.rb +41 -0
  208. data/lib/active_support/testing/setup_and_teardown.rb +21 -82
  209. data/lib/active_support/testing/stream.rb +42 -0
  210. data/lib/active_support/testing/tagged_logging.rb +25 -0
  211. data/lib/active_support/testing/time_helpers.rb +134 -0
  212. data/lib/active_support/time.rb +6 -23
  213. data/lib/active_support/time_with_zone.rb +239 -92
  214. data/lib/active_support/values/time_zone.rb +236 -160
  215. data/lib/active_support/values/unicode_tables.dat +0 -0
  216. data/lib/active_support/version.rb +5 -7
  217. data/lib/active_support/xml_mini/jdom.rb +19 -13
  218. data/lib/active_support/xml_mini/libxml.rb +3 -4
  219. data/lib/active_support/xml_mini/libxmlsax.rb +2 -3
  220. data/lib/active_support/xml_mini/nokogiri.rb +3 -4
  221. data/lib/active_support/xml_mini/nokogirisax.rb +2 -3
  222. data/lib/active_support/xml_mini/rexml.rb +8 -10
  223. data/lib/active_support/xml_mini.rb +66 -34
  224. data/lib/active_support.rb +40 -23
  225. metadata +185 -134
  226. data/CHANGELOG +0 -1534
  227. data/lib/active_support/base64.rb +0 -42
  228. data/lib/active_support/basic_object.rb +0 -21
  229. data/lib/active_support/buffered_logger.rb +0 -137
  230. data/lib/active_support/cache/compressed_mem_cache_store.rb +0 -13
  231. data/lib/active_support/cache/synchronized_memory_store.rb +0 -11
  232. data/lib/active_support/core_ext/array/random_access.rb +0 -30
  233. data/lib/active_support/core_ext/array/uniq_by.rb +0 -16
  234. data/lib/active_support/core_ext/class/delegating_attributes.rb +0 -44
  235. data/lib/active_support/core_ext/class/inheritable_attributes.rb +0 -178
  236. data/lib/active_support/core_ext/date/freeze.rb +0 -31
  237. data/lib/active_support/core_ext/date_time/zones.rb +0 -21
  238. data/lib/active_support/core_ext/exception.rb +0 -3
  239. data/lib/active_support/core_ext/file/path.rb +0 -5
  240. data/lib/active_support/core_ext/float/rounding.rb +0 -19
  241. data/lib/active_support/core_ext/float.rb +0 -1
  242. data/lib/active_support/core_ext/hash/deep_dup.rb +0 -11
  243. data/lib/active_support/core_ext/hash/diff.rb +0 -13
  244. data/lib/active_support/core_ext/kernel/requires.rb +0 -28
  245. data/lib/active_support/core_ext/logger.rb +0 -81
  246. data/lib/active_support/core_ext/module/attr_accessor_with_default.rb +0 -31
  247. data/lib/active_support/core_ext/module/method_names.rb +0 -14
  248. data/lib/active_support/core_ext/module/synchronization.rb +0 -43
  249. data/lib/active_support/core_ext/object/to_json.rb +0 -19
  250. data/lib/active_support/core_ext/proc.rb +0 -14
  251. data/lib/active_support/core_ext/process/daemon.rb +0 -23
  252. data/lib/active_support/core_ext/process.rb +0 -1
  253. data/lib/active_support/core_ext/range/blockless_step.rb +0 -29
  254. data/lib/active_support/core_ext/range/cover.rb +0 -3
  255. data/lib/active_support/core_ext/rexml.rb +0 -46
  256. data/lib/active_support/core_ext/string/encoding.rb +0 -11
  257. data/lib/active_support/core_ext/string/interpolation.rb +0 -2
  258. data/lib/active_support/core_ext/string/xchar.rb +0 -18
  259. data/lib/active_support/core_ext/time/publicize_conversion_methods.rb +0 -10
  260. data/lib/active_support/file_watcher.rb +0 -36
  261. data/lib/active_support/json/variable.rb +0 -9
  262. data/lib/active_support/memoizable.rb +0 -105
  263. data/lib/active_support/multibyte/exceptions.rb +0 -8
  264. data/lib/active_support/multibyte/utils.rb +0 -60
  265. data/lib/active_support/ruby/shim.rb +0 -22
  266. data/lib/active_support/secure_random.rb +0 -6
  267. data/lib/active_support/testing/mochaing.rb +0 -7
  268. data/lib/active_support/testing/pending.rb +0 -52
  269. data/lib/active_support/testing/performance/jruby.rb +0 -115
  270. data/lib/active_support/testing/performance/rubinius.rb +0 -113
  271. data/lib/active_support/testing/performance/ruby/mri.rb +0 -57
  272. data/lib/active_support/testing/performance/ruby/yarv.rb +0 -57
  273. data/lib/active_support/testing/performance/ruby.rb +0 -152
  274. data/lib/active_support/testing/performance.rb +0 -317
  275. data/lib/active_support/time/autoload.rb +0 -5
  276. data/lib/active_support/whiny_nil.rb +0 -60
data/CHANGELOG.md ADDED
@@ -0,0 +1,798 @@
1
+ ## Rails 5.0.0 (June 30, 2016) ##
2
+
3
+ * Support parsing JSON time in ISO8601 local time strings in
4
+ `ActiveSupport::JSON.decode` when `parse_json_times` is enabled.
5
+ Strings in the format of `YYYY-MM-DD hh:mm:ss` (without a `Z` at
6
+ the end) will be parsed in the local timezone (`Time.zone`). In
7
+ addition, date strings (`YYYY-MM-DD`) are now parsed into `Date`
8
+ objects.
9
+
10
+ *Grzegorz Witek*
11
+
12
+ * `Date.to_s` doesn't produce too many spaces. For example, `to_s(:short)`
13
+ will now produce `01 Feb` instead of ` 1 Feb`.
14
+
15
+ Fixes #25251.
16
+
17
+ *Sean Griffin*
18
+
19
+ * Rescuable: If a handler doesn't match the exception, check for handlers
20
+ matching the exception's cause.
21
+
22
+ *Jeremy Daer*
23
+
24
+ * `ActiveSupport::Duration` supports weeks and hours.
25
+
26
+ [1.hour.inspect, 1.hour.value, 1.hour.parts]
27
+ # => ["3600 seconds", 3600, [[:seconds, 3600]]] # Before
28
+ # => ["1 hour", 3600, [[:hours, 1]]] # After
29
+
30
+ [1.week.inspect, 1.week.value, 1.week.parts]
31
+ # => ["7 days", 604800, [[:days, 7]]] # Before
32
+ # => ["1 week", 604800, [[:weeks, 1]]] # After
33
+
34
+ This brings us into closer conformance with ISO8601 and relieves some
35
+ astonishment about getting `1.hour.inspect # => 3600 seconds`.
36
+
37
+ Compatibility: The duration's `value` remains the same, so apps using
38
+ durations are oblivious to the new time periods. Apps, libraries, and
39
+ plugins that work with the internal `parts` hash will need to broaden
40
+ their time period handling to cover hours & weeks.
41
+
42
+ *Andrey Novikov*
43
+
44
+ * Time zones: Ensure that the UTC offset reflects DST changes that occurred
45
+ since the app started. Removes UTC offset caching, reducing performance,
46
+ but this is still relatively quick and isn't in any hot paths.
47
+
48
+ *Alexey Shein*
49
+
50
+ * Make `getlocal` and `getutc` always return instances of `Time` for
51
+ `ActiveSupport::TimeWithZone` and `DateTime`. This eliminates a possible
52
+ stack level too deep error in `to_time` where `ActiveSupport::TimeWithZone`
53
+ was wrapping a `DateTime` instance. As a consequence of this the internal
54
+ time value in `ActiveSupport::TimeWithZone` is now always an instance of
55
+ `Time` in the UTC timezone, whether that's as the UTC time directly or
56
+ a representation of the local time in the timezone. There should be no
57
+ consequences of this internal change and if there are it's a bug due to
58
+ leaky abstractions.
59
+
60
+ *Andrew White*
61
+
62
+ * Add `DateTime#subsec` to return the fraction of a second as a `Rational`.
63
+
64
+ *Andrew White*
65
+
66
+ * Add additional aliases for `DateTime#utc` to mirror the ones on
67
+ `ActiveSupport::TimeWithZone` and `Time`.
68
+
69
+ *Andrew White*
70
+
71
+ * Add `DateTime#localtime` to return an instance of `Time` in the system's
72
+ local timezone. Also aliased to `getlocal`.
73
+
74
+ *Andrew White*, *Yuichiro Kaneko*
75
+
76
+ * Add `Time#sec_fraction` to return the fraction of a second as a `Rational`.
77
+
78
+ *Andrew White*
79
+
80
+ * Add `ActiveSupport.to_time_preserves_timezone` config option to control
81
+ how `to_time` handles timezones. In Ruby 2.4+ the behavior will change
82
+ from converting to the local system timezone, to preserving the timezone
83
+ of the receiver. This config option defaults to false so that apps made
84
+ with earlier versions of Rails are not affected when upgrading, e.g:
85
+
86
+ >> ENV['TZ'] = 'US/Eastern'
87
+
88
+ >> "2016-04-23T10:23:12.000Z".to_time
89
+ => "2016-04-23T06:23:12.000-04:00"
90
+
91
+ >> ActiveSupport.to_time_preserves_timezone = true
92
+
93
+ >> "2016-04-23T10:23:12.000Z".to_time
94
+ => "2016-04-23T10:23:12.000Z"
95
+
96
+ Fixes #24617.
97
+
98
+ *Andrew White*
99
+
100
+ * `ActiveSupport::TimeZone.country_zones(country_code)` looks up the
101
+ country's time zones by its two-letter ISO3166 country code, e.g.
102
+
103
+ >> ActiveSupport::TimeZone.country_zones(:jp).map(&:to_s)
104
+ => ["(GMT+09:00) Osaka"]
105
+
106
+ >> ActiveSupport::TimeZone.country_zones(:uy).map(&:to_s)
107
+ => ["(GMT-03:00) Montevideo"]
108
+
109
+ *Andrey Novikov*
110
+
111
+ * `Array#sum` compat with Ruby 2.4's native method.
112
+
113
+ Ruby 2.4 introduces `Array#sum`, but it only supports numeric elements,
114
+ breaking our `Enumerable#sum` which supports arbitrary `Object#+`.
115
+ To fix, override `Array#sum` with our compatible implementation.
116
+
117
+ Native Ruby 2.4:
118
+
119
+ %w[ a b ].sum
120
+ # => TypeError: String can't be coerced into Fixnum
121
+
122
+ With `Enumerable#sum` shim:
123
+
124
+ %w[ a b ].sum
125
+ # => 'ab'
126
+
127
+ We tried shimming the fast path and falling back to the compatible path
128
+ if it fails, but that ends up slower even in simple cases due to the cost
129
+ of exception handling. Our only choice is to override the native `Array#sum`
130
+ with our `Enumerable#sum`.
131
+
132
+ *Jeremy Daer*
133
+
134
+ * `ActiveSupport::Duration` supports ISO8601 formatting and parsing.
135
+
136
+ ActiveSupport::Duration.parse('P3Y6M4DT12H30M5S')
137
+ # => 3 years, 6 months, 4 days, 12 hours, 30 minutes, and 5 seconds
138
+
139
+ (3.years + 3.days).iso8601
140
+ # => "P3Y3D"
141
+
142
+ Inspired by Arnau Siches' [ISO8601 gem](https://github.com/arnau/ISO8601/)
143
+ and rewritten by Andrey Novikov with suggestions from Andrew White. Test
144
+ data from the ISO8601 gem redistributed under MIT license.
145
+
146
+ (Will be used to support the PostgreSQL interval data type.)
147
+
148
+ *Andrey Novikov*, *Arnau Siches*, *Andrew White*
149
+
150
+ * `Cache#fetch(key, force: true)` forces a cache miss, so it must be called
151
+ with a block to provide a new value to cache. Fetching with `force: true`
152
+ but without a block now raises ArgumentError.
153
+
154
+ cache.fetch('key', force: true) # => ArgumentError
155
+
156
+ *Santosh Wadghule*
157
+
158
+ * Fix behavior of JSON encoding for `Exception`.
159
+
160
+ *namusyaka*
161
+
162
+ * Make `number_to_phone` format number with regexp pattern.
163
+
164
+ number_to_phone(18812345678, pattern: /(\d{3})(\d{4})(\d{4})/)
165
+ # => 188-1234-5678
166
+
167
+ *Pan Gaoyong*
168
+
169
+ * Match `String#to_time`'s behaviour to that of ruby's implementation for edge cases.
170
+
171
+ `nil` is now returned instead of the current date if the string provided does
172
+ contain time information, but none that is used to build the `Time` object.
173
+
174
+ Fixes #22958.
175
+
176
+ *Siim Liiser*
177
+
178
+ * Rely on the native DateTime#<=> implementation to handle non-datetime like
179
+ objects instead of returning `nil` ourselves. This restores the ability
180
+ of `DateTime` instances to be compared with a `Numeric` that represents an
181
+ astronomical julian day number.
182
+
183
+ Fixes #24228.
184
+
185
+ *Andrew White*
186
+
187
+ * Add `String#upcase_first` method.
188
+
189
+ *Glauco Custódio*, *bogdanvlviv*
190
+
191
+ * Prevent `Marshal.load` from looping infinitely when trying to autoload a constant
192
+ which resolves to a different name.
193
+
194
+ *Olek Janiszewski*
195
+
196
+ * Deprecate `Module.local_constants`. Please use `Module.constants(false)` instead.
197
+
198
+ *Yuichiro Kaneko*
199
+
200
+ * Publish `ActiveSupport::Executor` and `ActiveSupport::Reloader` APIs to allow
201
+ components and libraries to manage, and participate in, the execution of
202
+ application code, and the application reloading process.
203
+
204
+ *Matthew Draper*
205
+
206
+ * Deprecate arguments on `assert_nothing_raised`.
207
+
208
+ `assert_nothing_raised` does not assert the arguments that have been passed
209
+ in (usually a specific exception class) since the method only yields the
210
+ block. So as not to confuse the users that the arguments have meaning, they
211
+ are being deprecated.
212
+
213
+ *Tara Scherner de la Fuente*
214
+
215
+ * Make `benchmark('something', silence: true)` actually work.
216
+
217
+ *DHH*
218
+
219
+ * Add `#on_weekday?` method to `Date`, `Time`, and `DateTime`.
220
+
221
+ `#on_weekday?` returns `true` if the receiving date/time does not fall on a Saturday
222
+ or Sunday.
223
+
224
+ *Vipul A M*
225
+
226
+ * Add `Array#second_to_last` and `Array#third_to_last` methods.
227
+
228
+ *Brian Christian*
229
+
230
+ * Fix regression in `Hash#dig` for HashWithIndifferentAccess.
231
+
232
+ *Jon Moss*
233
+
234
+ * Change `number_to_currency` behavior for checking negativity.
235
+
236
+ Used `to_f.negative` instead of using `to_f.phase` for checking negativity
237
+ of a number in number_to_currency helper.
238
+ This change works same for all cases except when number is "-0.0".
239
+
240
+ -0.0.to_f.negative? => false
241
+ -0.0.to_f.phase? => 3.14
242
+
243
+ This change reverts changes from https://github.com/rails/rails/pull/6512.
244
+ But it should be acceptable as we could not find any currency which
245
+ supports negative zeros.
246
+
247
+ *Prathamesh Sonpatki*, *Rafael Mendonça França*
248
+
249
+ * Match `HashWithIndifferentAccess#default`'s behaviour with `Hash#default`.
250
+
251
+ *David Cornu*
252
+
253
+ * Adds `:exception_object` key to `ActiveSupport::Notifications::Instrumenter`
254
+ payload when an exception is raised.
255
+
256
+ Adds new key/value pair to payload when an exception is raised:
257
+ e.g. `:exception_object => #<RuntimeError: FAIL>`.
258
+
259
+ *Ryan T. Hosford*
260
+
261
+ * Support extended grapheme clusters and UAX 29.
262
+
263
+ *Adam Roben*
264
+
265
+ * Add petabyte and exabyte numeric conversion.
266
+
267
+ *Akshay Vishnoi*
268
+
269
+ * Add thread_m/cattr_accessor/reader/writer suite of methods for declaring class and module variables that live per-thread.
270
+ This makes it easy to declare per-thread globals that are encapsulated. Note: This is a sharp edge. A wild proliferation
271
+ of globals is A Bad Thing. But like other sharp tools, when it's right, it's right.
272
+
273
+ Here's an example of a simple event tracking system where the object being tracked needs not pass a creator that it
274
+ doesn't need itself along:
275
+
276
+ module Current
277
+ thread_mattr_accessor :account
278
+ thread_mattr_accessor :user
279
+
280
+ def self.reset() self.account = self.user = nil end
281
+ end
282
+
283
+ class ApplicationController < ActionController::Base
284
+ before_action :set_current
285
+ after_action { Current.reset }
286
+
287
+ private
288
+ def set_current
289
+ Current.account = Account.find(params[:account_id])
290
+ Current.user = Current.account.users.find(params[:user_id])
291
+ end
292
+ end
293
+
294
+ class MessagesController < ApplicationController
295
+ def create
296
+ @message = Message.create!(message_params)
297
+ end
298
+ end
299
+
300
+ class Message < ApplicationRecord
301
+ has_many :events
302
+ after_create :track_created
303
+
304
+ private
305
+ def track_created
306
+ events.create! origin: self, action: :create
307
+ end
308
+ end
309
+
310
+ class Event < ApplicationRecord
311
+ belongs_to :creator, class_name: 'User'
312
+ before_validation { self.creator ||= Current.user }
313
+ end
314
+
315
+ *DHH*
316
+
317
+
318
+ * Deprecated `Module#qualified_const_` in favour of the builtin Module#const_
319
+ methods.
320
+
321
+ *Genadi Samokovarov*
322
+
323
+ * Deprecate passing string to define callback.
324
+
325
+ *Yuichiro Kaneko*
326
+
327
+ * `ActiveSupport::Cache::Store#namespaced_key`,
328
+ `ActiveSupport::Cache::MemCachedStore#escape_key`, and
329
+ `ActiveSupport::Cache::FileStore#key_file_path`
330
+ are deprecated and replaced with `normalize_key` that now calls `super`.
331
+
332
+ `ActiveSupport::Cache::LocaleCache#set_cache_value` is deprecated and replaced with `write_cache_value`.
333
+
334
+ *Michael Grosser*
335
+
336
+ * Implements an evented file watcher to asynchronously detect changes in the
337
+ application source code, routes, locales, etc.
338
+
339
+ This watcher is disabled by default, applications my enable it in the configuration:
340
+
341
+ # config/environments/development.rb
342
+ config.file_watcher = ActiveSupport::EventedFileUpdateChecker
343
+
344
+ This feature depends on the [listen](https://github.com/guard/listen) gem:
345
+
346
+ group :development do
347
+ gem 'listen', '~> 3.0.5'
348
+ end
349
+
350
+ *Puneet Agarwal* and *Xavier Noria*
351
+
352
+ * Added `Time.days_in_year` to return the number of days in the given year, or the
353
+ current year if no argument is provided.
354
+
355
+ *Jon Pascoe*
356
+
357
+ * Updated `parameterize` to preserve the case of a string, optionally.
358
+
359
+ Example:
360
+
361
+ parameterize("Donald E. Knuth", separator: '_') # => "donald_e_knuth"
362
+ parameterize("Donald E. Knuth", preserve_case: true) # => "Donald-E-Knuth"
363
+
364
+ *Swaathi Kakarla*
365
+
366
+ * `HashWithIndifferentAccess.new` respects the default value or proc on objects
367
+ that respond to `#to_hash`. `.new_from_hash_copying_default` simply invokes `.new`.
368
+ All calls to `.new_from_hash_copying_default` are replaced with `.new`.
369
+
370
+ *Gordon Chan*
371
+
372
+ * Change Integer#year to return a Fixnum instead of a Float to improve
373
+ consistency.
374
+
375
+ Integer#years returned a Float while the rest of the accompanying methods
376
+ (days, weeks, months, etc.) return a Fixnum.
377
+
378
+ Before:
379
+
380
+ 1.year # => 31557600.0
381
+
382
+ After:
383
+
384
+ 1.year # => 31557600
385
+
386
+ *Konstantinos Rousis*
387
+
388
+ * Handle invalid UTF-8 strings when HTML escaping.
389
+
390
+ Use `ActiveSupport::Multibyte::Unicode.tidy_bytes` to handle invalid UTF-8
391
+ strings in `ERB::Util.unwrapped_html_escape` and `ERB::Util.html_escape_once`.
392
+ Prevents user-entered input passed from a querystring into a form field from
393
+ causing invalid byte sequence errors.
394
+
395
+ *Grey Baker*
396
+
397
+ * Update `ActiveSupport::Multibyte::Chars#slice!` to return `nil` if the
398
+ arguments are out of bounds, to mirror the behavior of `String#slice!`
399
+
400
+ *Gourav Tiwari*
401
+
402
+ * Fix `number_to_human` so that 999999999 rounds to "1 Billion" instead of
403
+ "1000 Million".
404
+
405
+ *Max Jacobson*
406
+
407
+ * Fix `ActiveSupport::Deprecation#deprecate_methods` to report using the
408
+ current deprecator instance, where applicable.
409
+
410
+ *Brandon Dunne*
411
+
412
+ * `Cache#fetch` instrumentation marks whether it was a `:hit`.
413
+
414
+ *Robin Clowers*
415
+
416
+ * `assert_difference` and `assert_no_difference` now returns the result of the
417
+ yielded block.
418
+
419
+ Example:
420
+
421
+ post = assert_difference -> { Post.count }, 1 do
422
+ Post.create
423
+ end
424
+
425
+ *Lucas Mazza*
426
+
427
+ * Short-circuit `blank?` on date and time values since they are never blank.
428
+
429
+ Fixes #21657.
430
+
431
+ *Andrew White*
432
+
433
+ * Replaced deprecated `ThreadSafe::Cache` with its successor `Concurrent::Map` now that
434
+ the thread_safe gem has been merged into concurrent-ruby.
435
+
436
+ *Jerry D'Antonio*
437
+
438
+ * Updated Unicode version to 8.0.0
439
+
440
+ *Anshul Sharma*
441
+
442
+ * `number_to_currency` and `number_with_delimiter` now accept custom `delimiter_pattern` option
443
+ to handle placement of delimiter, to support currency formats like INR
444
+
445
+ Example:
446
+
447
+ number_to_currency(1230000, delimiter_pattern: /(\d+?)(?=(\d\d)+(\d)(?!\d))/, unit: '₹', format: "%u %n")
448
+ # => '₹ 12,30,000.00'
449
+
450
+ *Vipul A M*
451
+
452
+ * Deprecate `:prefix` option of `number_to_human_size` with no replacement.
453
+
454
+ *Jean Boussier*
455
+
456
+ * Fix `TimeWithZone#eql?` to properly handle `TimeWithZone` created from `DateTime`:
457
+ twz = DateTime.now.in_time_zone
458
+ twz.eql?(twz.dup) => true
459
+
460
+ Fixes #14178.
461
+
462
+ *Roque Pinel*
463
+
464
+ * ActiveSupport::HashWithIndifferentAccess `select` and `reject` will now return
465
+ enumerator if called without block.
466
+
467
+ Fixes #20095.
468
+
469
+ *Bernard Potocki*
470
+
471
+ * Removed `ActiveSupport::Concurrency::Latch`, superseded by `Concurrent::CountDownLatch`
472
+ from the concurrent-ruby gem.
473
+
474
+ *Jerry D'Antonio*
475
+
476
+ * Fix not calling `#default` on `HashWithIndifferentAccess#to_hash` when only
477
+ `default_proc` is set, which could raise.
478
+
479
+ *Simon Eskildsen*
480
+
481
+ * Fix setting `default_proc` on `HashWithIndifferentAccess#dup`.
482
+
483
+ *Simon Eskildsen*
484
+
485
+ * Fix a range of values for parameters of the Time#change.
486
+
487
+ *Nikolay Kondratyev*
488
+
489
+ * Add `Enumerable#pluck` to get the same values from arrays as from ActiveRecord
490
+ associations.
491
+
492
+ Fixes #20339.
493
+
494
+ *Kevin Deisz*
495
+
496
+ * Add a bang version to `ActiveSupport::OrderedOptions` get methods which will raise
497
+ an `KeyError` if the value is `.blank?`.
498
+
499
+ Before:
500
+
501
+ if (slack_url = Rails.application.secrets.slack_url).present?
502
+ # Do something worthwhile
503
+ else
504
+ # Raise as important secret password is not specified
505
+ end
506
+
507
+ After:
508
+
509
+ slack_url = Rails.application.secrets.slack_url!
510
+
511
+ *Aditya Sanghi*, *Gaurish Sharma*
512
+
513
+ * Remove deprecated `Class#superclass_delegating_accessor`.
514
+ Use `Class#class_attribute` instead.
515
+
516
+ *Akshay Vishnoi*
517
+
518
+ * Patch `Delegator` to work with `#try`.
519
+
520
+ Fixes #5790.
521
+
522
+ *Nate Smith*
523
+
524
+ * Add `Integer#positive?` and `Integer#negative?` query methods
525
+ in the vein of `Fixnum#zero?`.
526
+
527
+ This makes it nicer to do things like `bunch_of_numbers.select(&:positive?)`.
528
+
529
+ *DHH*
530
+
531
+ * Encoding `ActiveSupport::TimeWithZone` to YAML now preserves the timezone information.
532
+
533
+ Fixes #9183.
534
+
535
+ *Andrew White*
536
+
537
+ * Added `ActiveSupport::TimeZone#strptime` to allow parsing times as if
538
+ from a given timezone.
539
+
540
+ *Paul A Jungwirth*
541
+
542
+ * `ActiveSupport::Callbacks#skip_callback` now raises an `ArgumentError` if
543
+ an unrecognized callback is removed.
544
+
545
+ *Iain Beeston*
546
+
547
+ * Added `ActiveSupport::ArrayInquirer` and `Array#inquiry`.
548
+
549
+ Wrapping an array in an `ArrayInquirer` gives a friendlier way to check its
550
+ contents:
551
+
552
+ variants = ActiveSupport::ArrayInquirer.new([:phone, :tablet])
553
+
554
+ variants.phone? # => true
555
+ variants.tablet? # => true
556
+ variants.desktop? # => false
557
+
558
+ variants.any?(:phone, :tablet) # => true
559
+ variants.any?(:phone, :desktop) # => true
560
+ variants.any?(:desktop, :watch) # => false
561
+
562
+ `Array#inquiry` is a shortcut for wrapping the receiving array in an
563
+ `ArrayInquirer`.
564
+
565
+ *George Claghorn*
566
+
567
+ * Deprecate `alias_method_chain` in favour of `Module#prepend` introduced in
568
+ Ruby 2.0.
569
+
570
+ *Kir Shatrov*
571
+
572
+ * Added `#without` on `Enumerable` and `Array` to return a copy of an
573
+ enumerable without the specified elements.
574
+
575
+ *Todd Bealmear*
576
+
577
+ * Fixed a problem where `String#truncate_words` would get stuck with a complex
578
+ string.
579
+
580
+ *Henrik Nygren*
581
+
582
+ * Fixed a roundtrip problem with `AS::SafeBuffer` where primitive-like strings
583
+ will be dumped as primitives:
584
+
585
+ Before:
586
+
587
+ YAML.load ActiveSupport::SafeBuffer.new("Hello").to_yaml # => "Hello"
588
+ YAML.load ActiveSupport::SafeBuffer.new("true").to_yaml # => true
589
+ YAML.load ActiveSupport::SafeBuffer.new("false").to_yaml # => false
590
+ YAML.load ActiveSupport::SafeBuffer.new("1").to_yaml # => 1
591
+ YAML.load ActiveSupport::SafeBuffer.new("1.1").to_yaml # => 1.1
592
+
593
+ After:
594
+
595
+ YAML.load ActiveSupport::SafeBuffer.new("Hello").to_yaml # => "Hello"
596
+ YAML.load ActiveSupport::SafeBuffer.new("true").to_yaml # => "true"
597
+ YAML.load ActiveSupport::SafeBuffer.new("false").to_yaml # => "false"
598
+ YAML.load ActiveSupport::SafeBuffer.new("1").to_yaml # => "1"
599
+ YAML.load ActiveSupport::SafeBuffer.new("1.1").to_yaml # => "1.1"
600
+
601
+ *Godfrey Chan*
602
+
603
+ * Enable `number_to_percentage` to keep the number's precision by allowing
604
+ `:precision` to be `nil`.
605
+
606
+ *Jack Xu*
607
+
608
+ * `config_accessor` became a private method, as with Ruby's `attr_accessor`.
609
+
610
+ *Akira Matsuda*
611
+
612
+ * `AS::Testing::TimeHelpers#travel_to` now changes `DateTime.now` as well as
613
+ `Time.now` and `Date.today`.
614
+
615
+ *Yuki Nishijima*
616
+
617
+ * Add `file_fixture` to `ActiveSupport::TestCase`.
618
+ It provides a simple mechanism to access sample files in your test cases.
619
+
620
+ By default file fixtures are stored in `test/fixtures/files`. This can be
621
+ configured per test-case using the `file_fixture_path` class attribute.
622
+
623
+ *Yves Senn*
624
+
625
+ * Return value of yielded block in `File.atomic_write`.
626
+
627
+ *Ian Ker-Seymer*
628
+
629
+ * Duplicate frozen array when assigning it to a `HashWithIndifferentAccess` so
630
+ that it doesn't raise a `RuntimeError` when calling `map!` on it in `convert_value`.
631
+
632
+ Fixes #18550.
633
+
634
+ *Aditya Kapoor*
635
+
636
+ * Add missing time zone definitions for Russian Federation and sync them
637
+ with `zone.tab` file from tzdata version 2014j (latest).
638
+
639
+ *Andrey Novikov*
640
+
641
+ * Add `SecureRandom.base58` for generation of random base58 strings.
642
+
643
+ *Matthew Draper*, *Guillermo Iguaran*
644
+
645
+ * Add `#prev_day` and `#next_day` counterparts to `#yesterday` and
646
+ `#tomorrow` for `Date`, `Time`, and `DateTime`.
647
+
648
+ *George Claghorn*
649
+
650
+ * Add `same_time` option to `#next_week` and `#prev_week` for `Date`, `Time`,
651
+ and `DateTime`.
652
+
653
+ *George Claghorn*
654
+
655
+ * Add `#on_weekend?`, `#next_weekday`, `#prev_weekday` methods to `Date`,
656
+ `Time`, and `DateTime`.
657
+
658
+ `#on_weekend?` returns `true` if the receiving date/time falls on a Saturday
659
+ or Sunday.
660
+
661
+ `#next_weekday` returns a new date/time representing the next day that does
662
+ not fall on a Saturday or Sunday.
663
+
664
+ `#prev_weekday` returns a new date/time representing the previous day that
665
+ does not fall on a Saturday or Sunday.
666
+
667
+ *George Claghorn*
668
+
669
+ * Added ability to `TaggedLogging` to allow loggers to be instantiated multiple times
670
+ so that they don't share tags with each other.
671
+
672
+ Rails.logger = Logger.new(STDOUT)
673
+
674
+ # Before
675
+ custom_logger = ActiveSupport::TaggedLogging.new(Rails.logger)
676
+ custom_logger.push_tags "custom_tag"
677
+ custom_logger.info "test" # => "[custom_tag] [custom_tag] test"
678
+ Rails.logger.info "test" # => "[custom_tag] [custom_tag] test"
679
+
680
+ # After
681
+ custom_logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
682
+ custom_logger.push_tags "custom_tag"
683
+ custom_logger.info "test" # => "[custom_tag] test"
684
+ Rails.logger.info "test" # => "test"
685
+
686
+ *Alexander Staubo*
687
+
688
+ * Change the default test order from `:sorted` to `:random`.
689
+
690
+ *Rafael Mendonça França*
691
+
692
+ * Remove deprecated `ActiveSupport::JSON::Encoding::CircularReferenceError`.
693
+
694
+ *Rafael Mendonça França*
695
+
696
+ * Remove deprecated methods `ActiveSupport::JSON::Encoding.encode_big_decimal_as_string=`
697
+ and `ActiveSupport::JSON::Encoding.encode_big_decimal_as_string`.
698
+
699
+ *Rafael Mendonça França*
700
+
701
+ * Remove deprecated `ActiveSupport::SafeBuffer#prepend`.
702
+
703
+ *Rafael Mendonça França*
704
+
705
+ * Remove deprecated methods at `Kernel`.
706
+
707
+ `silence_stderr`, `silence_stream`, `capture` and `quietly`.
708
+
709
+ *Rafael Mendonça França*
710
+
711
+ * Remove deprecated `active_support/core_ext/big_decimal/yaml_conversions`
712
+ file.
713
+
714
+ *Rafael Mendonça França*
715
+
716
+ * Remove deprecated methods `ActiveSupport::Cache::Store.instrument` and
717
+ `ActiveSupport::Cache::Store.instrument=`.
718
+
719
+ *Rafael Mendonça França*
720
+
721
+ * Change the way in which callback chains can be halted.
722
+
723
+ The preferred method to halt a callback chain from now on is to explicitly
724
+ `throw(:abort)`.
725
+ In the past, callbacks could only be halted by explicitly providing a
726
+ terminator and by having a callback match the conditions of the terminator.
727
+
728
+ * Add `ActiveSupport.halt_callback_chains_on_return_false`
729
+
730
+ Setting `ActiveSupport.halt_callback_chains_on_return_false`
731
+ to `true` will let an app support the deprecated way of halting Active Record,
732
+ and Active Model callback chains by returning `false`.
733
+
734
+ Setting the value to `false` will tell the app to ignore any `false` value
735
+ returned by those callbacks, and only halt the chain upon `throw(:abort)`.
736
+
737
+ When the configuration option is missing, its value is `true`, so older apps
738
+ ported to Rails 5.0 will not break (but display a deprecation warning).
739
+ For new Rails 5.0 apps, its value is set to `false` in an initializer, so
740
+ these apps will support the new behavior by default.
741
+
742
+ *claudiob*, *Roque Pinel*
743
+
744
+ * Changes arguments and default value of CallbackChain's `:terminator` option
745
+
746
+ Chains of callbacks defined without an explicit `:terminator` option will
747
+ now be halted as soon as a `before_` callback throws `:abort`.
748
+
749
+ Chains of callbacks defined with a `:terminator` option will maintain their
750
+ existing behavior of halting as soon as a `before_` callback matches the
751
+ terminator's expectation.
752
+
753
+ *claudiob*
754
+
755
+ * Deprecate `MissingSourceFile` in favor of `LoadError`.
756
+
757
+ `MissingSourceFile` was just an alias to `LoadError` and was not being
758
+ raised inside the framework.
759
+
760
+ *Rafael Mendonça França*
761
+
762
+ * Remove `Object#itself` as it is implemented in Ruby 2.2.
763
+
764
+ *Cristian Bica*
765
+
766
+ * Add support for error dispatcher classes in `ActiveSupport::Rescuable`.
767
+ Now it acts closer to Ruby's rescue.
768
+
769
+ Example:
770
+
771
+ class BaseController < ApplicationController
772
+ module ErrorDispatcher
773
+ def self.===(other)
774
+ Exception === other && other.respond_to?(:status)
775
+ end
776
+ end
777
+
778
+ rescue_from ErrorDispatcher do |error|
779
+ render status: error.status, json: { error: error.to_s }
780
+ end
781
+ end
782
+
783
+ *Genadi Samokovarov*
784
+
785
+ * Add `#verified` and `#valid_message?` methods to `ActiveSupport::MessageVerifier`
786
+
787
+ Previously, the only way to decode a message with `ActiveSupport::MessageVerifier`
788
+ was to use `#verify`, which would raise an exception on invalid messages. Now
789
+ `#verified` can also be used, which returns `nil` on messages that cannot be
790
+ decoded.
791
+
792
+ Previously, there was no way to check if a message's format was valid without
793
+ attempting to decode it. `#valid_message?` is a boolean convenience method that
794
+ checks whether the message is valid without actually decoding it.
795
+
796
+ *Logan Leger*
797
+
798
+ Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/activesupport/CHANGELOG.md) for previous changes.