activesupport 5.0.7.1

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