2011-12-19 21:41:37 -05:00
|
|
|
## Rails 4.0.0 (unreleased) ##
|
2012-11-09 09:24:05 -05:00
|
|
|
|
2012-11-17 11:24:33 -05:00
|
|
|
* Deprecate `ActiveSupport::TestCase#pending` method, use `skip` from MiniTest instead. *Carlos Antonio da Silva*
|
|
|
|
|
2012-11-14 00:58:33 -05:00
|
|
|
* `XmlMini.with_backend` now may be safely used with threads:
|
|
|
|
|
|
|
|
Thread.new do
|
|
|
|
XmlMini.with_backend("REXML") { rexml_power }
|
|
|
|
end
|
|
|
|
Thread.new do
|
|
|
|
XmlMini.with_backend("LibXML") { libxml_power }
|
|
|
|
end
|
|
|
|
|
|
|
|
Each thread will use it's own backend.
|
|
|
|
|
|
|
|
*Nikita Afanasenko*
|
|
|
|
|
2012-11-15 05:06:35 -05:00
|
|
|
* Dependencies no longer trigger Kernel#autoload in remove_constant [fixes #8213]. *Xavier Noria*
|
2012-11-14 22:33:17 -05:00
|
|
|
|
2012-11-13 05:49:18 -05:00
|
|
|
* Simplify mocha integration and remove monkey-patches, bumping mocha to 0.13.0. *James Mead*
|
|
|
|
|
2012-11-12 08:33:20 -05:00
|
|
|
* `#as_json` isolates options when encoding a hash.
|
|
|
|
Fix #8182
|
|
|
|
|
|
|
|
*Yves Senn*
|
|
|
|
|
2012-11-09 09:24:05 -05:00
|
|
|
* Deprecate Hash#diff in favor of MiniTest's #diff. *Steve Klabnik*
|
|
|
|
|
2012-09-26 05:04:41 -04:00
|
|
|
* Kernel#capture can catch output from subprocesses *Dmitry Vorotilin*
|
2011-12-19 21:41:37 -05:00
|
|
|
|
2012-11-03 07:25:27 -04:00
|
|
|
* `to_xml` conversions now use builder's `tag!` method instead of explicit invocation of `method_missing`.
|
|
|
|
|
|
|
|
*Nikita Afanasenko*
|
|
|
|
|
2012-11-01 20:58:17 -04:00
|
|
|
* Fixed timezone mapping of the Solomon Islands. *Steve Klabnik*
|
|
|
|
|
2012-10-29 22:23:41 -04:00
|
|
|
* Make callstack attribute optional in
|
|
|
|
ActiveSupport::Deprecation::Reporting methods `warn` and `deprecation_warning`
|
|
|
|
|
|
|
|
*Alexey Gaziev*
|
|
|
|
|
2012-10-16 15:05:25 -04:00
|
|
|
* Implement HashWithIndifferentAccess#replace so key? works correctly. *David Graham*
|
|
|
|
|
2012-10-25 04:06:40 -04:00
|
|
|
* Handle the possible Permission Denied errors atomic.rb might trigger due to its chown and chmod calls. *Daniele Sluijters*
|
|
|
|
|
2012-09-21 04:43:59 -04:00
|
|
|
* Hash#extract! returns only those keys that present in the receiver.
|
2012-07-08 17:10:16 -04:00
|
|
|
|
|
|
|
{:a => 1, :b => 2}.extract!(:a, :x) # => {:a => 1}
|
|
|
|
|
|
|
|
*Mikhail Dieterle*
|
|
|
|
|
2012-09-21 04:43:59 -04:00
|
|
|
* Hash#extract! returns the same subclass, that the receiver is. I.e.
|
2012-07-08 17:10:16 -04:00
|
|
|
HashWithIndifferentAccess#extract! returns HashWithIndifferentAccess instance.
|
|
|
|
|
|
|
|
*Mikhail Dieterle*
|
|
|
|
|
2012-10-01 22:17:13 -04:00
|
|
|
* Optimize ActiveSupport::Cache::Entry to reduce memory and processing overhead. *Brian Durand*
|
|
|
|
|
2012-09-26 14:16:43 -04:00
|
|
|
* Tests tag the Rails log with the current test class and test case:
|
|
|
|
|
|
|
|
[SessionsControllerTest] [test_0002_sign in] Processing by SessionsController#create as HTML
|
|
|
|
[SessionsControllerTest] [test_0002_sign in] ...
|
|
|
|
|
|
|
|
*Jeremy Kemper*
|
|
|
|
|
2012-09-26 13:08:20 -04:00
|
|
|
* Add logger.push_tags and .pop_tags to complement logger.tagged:
|
|
|
|
|
|
|
|
class Job
|
|
|
|
def before
|
|
|
|
Rails.logger.push_tags :jobs, self.class.name
|
|
|
|
end
|
|
|
|
|
|
|
|
def after
|
|
|
|
Rails.logger.pop_tags 2
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
*Jeremy Kemper*
|
|
|
|
|
2012-09-20 17:47:57 -04:00
|
|
|
* Allow delegation to the class using the `:class` keyword, replacing
|
|
|
|
`self.class` usage:
|
|
|
|
|
|
|
|
class User
|
|
|
|
def self.hello
|
|
|
|
"world"
|
|
|
|
end
|
|
|
|
|
|
|
|
delegate :hello, to: :class
|
|
|
|
end
|
|
|
|
|
|
|
|
*Marc-Andre Lafortune*
|
|
|
|
|
|
|
|
* `Date.beginning_of_week` thread local and `beginning_of_week` application
|
|
|
|
config option added (default is Monday).
|
|
|
|
|
|
|
|
*Innokenty Mikhailov*
|
2012-09-18 10:18:19 -04:00
|
|
|
|
2012-09-14 15:25:21 -04:00
|
|
|
* An optional block can be passed to `config_accessor` to set its default value
|
|
|
|
|
|
|
|
class User
|
|
|
|
include ActiveSupport::Configurable
|
|
|
|
config_accessor :hair_colors do
|
|
|
|
[:brown, :black, :blonde, :red]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
User.hair_colors # => [:brown, :black, :blonde, :red]
|
|
|
|
|
|
|
|
*Larry Lv*
|
|
|
|
|
2012-09-14 10:52:15 -04:00
|
|
|
* ActiveSupport::Benchmarkable#silence has been deprecated due to its lack of
|
2012-09-20 17:47:57 -04:00
|
|
|
thread safety. It will be removed without replacement in Rails 4.1.
|
|
|
|
|
|
|
|
*Steve Klabnik*
|
|
|
|
|
|
|
|
* An optional block can be passed to `Hash#deep_merge`. The block will be invoked
|
|
|
|
for each duplicated key and used to resolve the conflict.
|
2012-09-14 10:52:15 -04:00
|
|
|
|
2012-09-20 17:47:57 -04:00
|
|
|
*Pranas Kiziela*
|
2012-09-13 14:49:49 -04:00
|
|
|
|
2012-09-13 02:38:34 -04:00
|
|
|
* ActiveSupport::Deprecation is now a class. It is possible to create an instance
|
|
|
|
of deprecator. Backwards compatibility has been preserved.
|
|
|
|
|
|
|
|
You can choose which instance of the deprecator will be used.
|
|
|
|
|
2012-09-13 13:02:18 -04:00
|
|
|
deprecate :method_name, :deprecator => deprecator_instance
|
2012-09-13 02:38:34 -04:00
|
|
|
|
|
|
|
You can use ActiveSupport::Deprecation in your gem.
|
|
|
|
|
2012-09-13 13:02:18 -04:00
|
|
|
require 'active_support/deprecation'
|
|
|
|
require 'active_support/core_ext/module/deprecation'
|
2012-09-13 02:38:34 -04:00
|
|
|
|
2012-09-13 13:02:18 -04:00
|
|
|
class MyGem
|
|
|
|
def self.deprecator
|
|
|
|
ActiveSupport::Deprecation.new('2.0', 'MyGem')
|
|
|
|
end
|
2012-09-13 02:38:34 -04:00
|
|
|
|
2012-09-13 13:02:18 -04:00
|
|
|
def old_method
|
|
|
|
end
|
2012-09-13 02:38:34 -04:00
|
|
|
|
2012-09-13 13:02:18 -04:00
|
|
|
def new_method
|
|
|
|
end
|
2012-09-13 02:38:34 -04:00
|
|
|
|
2012-09-13 13:02:18 -04:00
|
|
|
deprecate :old_method => :new_method, :deprecator => deprecator
|
|
|
|
end
|
2012-09-13 02:38:34 -04:00
|
|
|
|
2012-09-13 13:02:18 -04:00
|
|
|
MyGem.new.old_method
|
|
|
|
# => DEPRECATION WARNING: old_method is deprecated and will be removed from MyGem 2.0 (use new_method instead). (called from <main> at file.rb:18)
|
2012-09-13 02:38:34 -04:00
|
|
|
|
|
|
|
*Piotr Niełacny & Robert Pankowecki*
|
|
|
|
|
2012-09-03 05:42:24 -04:00
|
|
|
* `ERB::Util.html_escape` encodes single quote as `#39`. Decimal form has better support in old browsers. *Kalys Osmonov*
|
|
|
|
|
2012-09-07 10:03:07 -04:00
|
|
|
* `ActiveSupport::Callbacks`: deprecate monkey patch of object callbacks.
|
|
|
|
Using the #filter method like this:
|
|
|
|
|
|
|
|
before_filter MyFilter.new
|
|
|
|
|
|
|
|
class MyFilter
|
|
|
|
def filter(controller)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Is now deprecated with recommendation to use the corresponding filter type
|
|
|
|
(`#before`, `#after` or `#around`):
|
|
|
|
|
|
|
|
before_filter MyFilter.new
|
|
|
|
|
|
|
|
class MyFilter
|
|
|
|
def before(controller)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
*Bogdan Gusiev*
|
|
|
|
|
2012-09-03 18:13:49 -04:00
|
|
|
* An optional block can be passed to `HashWithIndifferentAccess#update` and `#merge`.
|
|
|
|
The block will be invoked for each duplicated key, and used to resolve the conflict,
|
|
|
|
thus replicating the behaviour of the corresponding methods on the `Hash` class.
|
|
|
|
|
|
|
|
*Leo Cassarani*
|
|
|
|
|
2012-08-21 17:39:37 -04:00
|
|
|
* Remove `j` alias for `ERB::Util#json_escape`.
|
|
|
|
The `j` alias is already used for `ActionView::Helpers::JavaScriptHelper#escape_javascript`
|
|
|
|
and both modules are included in the view context that would confuse the developers.
|
|
|
|
|
|
|
|
*Akira Matsuda*
|
|
|
|
|
2012-06-28 22:47:46 -04:00
|
|
|
* Replace deprecated `memcache-client` gem with `dalli` in ActiveSupport::Cache::MemCacheStore
|
|
|
|
|
|
|
|
*Guillermo Iguaran*
|
|
|
|
|
2012-06-23 19:05:42 -04:00
|
|
|
* Add default values to all `ActiveSupport::NumberHelper` methods, to avoid
|
|
|
|
errors with empty locales or missing values.
|
|
|
|
|
|
|
|
*Carlos Antonio da Silva*
|
|
|
|
|
2012-09-07 10:11:00 -04:00
|
|
|
* `ActiveSupport::JSON::Variable` is deprecated. Define your own `#as_json` and
|
|
|
|
`#encode_json` methods for custom JSON string literals.
|
2012-08-10 23:10:11 -04:00
|
|
|
|
|
|
|
*Erich Menge*
|
|
|
|
|
|
|
|
* Add String#indent. *fxn & Ace Suares*
|
|
|
|
|
|
|
|
* Inflections can now be defined per locale. `singularize` and `pluralize`
|
|
|
|
accept locale as an extra argument.
|
|
|
|
|
|
|
|
*David Celis*
|
|
|
|
|
|
|
|
* `Object#try` will now return nil instead of raise a NoMethodError if the
|
|
|
|
receiving object does not implement the method, but you can still get the
|
|
|
|
old behavior by using the new `Object#try!`.
|
|
|
|
|
|
|
|
*DHH*
|
|
|
|
|
2012-08-09 19:54:52 -04:00
|
|
|
* `ERB::Util.html_escape` now escapes single quotes. *Santiago Pastorino*
|
2012-07-27 13:20:50 -04:00
|
|
|
|
2012-07-01 13:34:47 -04:00
|
|
|
* `Time#change` now works with time values with offsets other than UTC or the local time zone. *Andrew White*
|
2012-07-01 04:11:21 -04:00
|
|
|
|
2012-07-01 13:34:47 -04:00
|
|
|
* `ActiveSupport::Callbacks`: deprecate usage of filter object with `#before` and `#after` methods as `around` callback. *Bogdan Gusiev*
|
2012-06-24 03:30:34 -04:00
|
|
|
|
2012-07-01 13:34:47 -04:00
|
|
|
* Add `Time#prev_quarter` and `Time#next_quarter` short-hands for `months_ago(3)` and `months_since(3)`. *SungHee Kang*
|
2012-05-20 01:33:58 -04:00
|
|
|
|
2012-06-09 18:35:18 -04:00
|
|
|
* Remove obsolete and unused `require_association` method from dependencies. *fxn*
|
|
|
|
|
2012-06-05 11:50:48 -04:00
|
|
|
* Add `:instance_accessor` option for `config_accessor`.
|
|
|
|
|
|
|
|
class User
|
|
|
|
include ActiveSupport::Configurable
|
|
|
|
config_accessor :allowed_access, instance_accessor: false
|
|
|
|
end
|
|
|
|
|
|
|
|
User.new.allowed_access = true # => NoMethodError
|
|
|
|
User.new.allowed_access # => NoMethodError
|
|
|
|
|
|
|
|
*Francesco Rodriguez*
|
|
|
|
|
2012-05-30 13:18:29 -04:00
|
|
|
* ActionView::Helpers::NumberHelper methods have been moved to ActiveSupport::NumberHelper and are now available via
|
|
|
|
Numeric#to_s. Numeric#to_s now accepts the formatting options :phone, :currency, :percentage, :delimited,
|
2012-05-14 20:47:55 -04:00
|
|
|
:rounded, :human, and :human_size. *Andrew Mutz*
|
|
|
|
|
2012-05-23 13:31:35 -04:00
|
|
|
* Add `Hash#transform_keys`, `Hash#transform_keys!`, `Hash#deep_transform_keys`, and `Hash#deep_transform_keys!`. *Mark McSpadden*
|
2012-05-10 17:05:19 -04:00
|
|
|
|
2012-04-29 14:43:06 -04:00
|
|
|
* Changed xml type `datetime` to `dateTime` (with upper case letter `T`). *Angelo Capilleri*
|
2012-05-23 03:59:13 -04:00
|
|
|
|
2012-02-24 16:29:00 -05:00
|
|
|
* Add `:instance_accessor` option for `class_attribute`. *Alexey Vakhov*
|
|
|
|
|
2012-05-19 10:46:12 -04:00
|
|
|
* `constantize` now looks in the ancestor chain. *Marc-Andre Lafortune & Andrew White*
|
|
|
|
|
2012-04-29 14:43:06 -04:00
|
|
|
* Adds `Hash#deep_stringify_keys` and `Hash#deep_stringify_keys!` to convert all keys from a +Hash+ instance into strings *Lucas Húngaro*
|
|
|
|
|
|
|
|
* Adds `Hash#deep_symbolize_keys` and `Hash#deep_symbolize_keys!` to convert all keys from a +Hash+ instance into symbols *Lucas Húngaro*
|
|
|
|
|
2012-05-12 11:48:34 -04:00
|
|
|
* `Object#try` can't call private methods. *Vasiliy Ermolovich*
|
2012-05-12 07:07:21 -04:00
|
|
|
|
2012-05-10 03:21:03 -04:00
|
|
|
* `AS::Callbacks#run_callbacks` remove `key` argument. *Francesco Rodriguez*
|
|
|
|
|
2012-05-09 08:40:08 -04:00
|
|
|
* `deep_dup` works more expectedly now and duplicates also values in +Hash+ instances and elements in +Array+ instances. *Alexey Gaziev*
|
2012-05-06 13:56:38 -04:00
|
|
|
|
2012-05-09 08:40:08 -04:00
|
|
|
* Inflector no longer applies ice -> ouse to words like slice, police, ets *Wes Morgan*
|
2012-04-30 03:17:01 -04:00
|
|
|
|
2012-05-09 08:40:08 -04:00
|
|
|
* Add `ActiveSupport::Deprecations.behavior = :silence` to completely ignore Rails runtime deprecations *twinturbo*
|
2012-04-17 16:01:06 -04:00
|
|
|
|
2012-05-09 08:40:08 -04:00
|
|
|
* Make Module#delegate stop using `send` - can no longer delegate to private methods. *dasch*
|
2012-04-12 08:59:21 -04:00
|
|
|
|
2012-05-09 08:40:08 -04:00
|
|
|
* AS::Callbacks: deprecate `:rescuable` option. *Bogdan Gusiev*
|
2012-02-22 10:43:13 -05:00
|
|
|
|
2012-05-09 08:40:08 -04:00
|
|
|
* Adds Integer#ordinal to get the ordinal suffix string of an integer. *Tim Gildea*
|
2012-02-04 08:08:26 -05:00
|
|
|
|
2012-05-09 08:40:08 -04:00
|
|
|
* AS::Callbacks: `:per_key` option is no longer supported
|
2012-02-04 06:31:00 -05:00
|
|
|
|
2012-05-09 08:40:08 -04:00
|
|
|
* `AS::Callbacks#define_callbacks`: add `:skip_after_callbacks_if_terminated` option.
|
2012-02-03 10:57:53 -05:00
|
|
|
|
2012-05-09 08:40:08 -04:00
|
|
|
* Add html_escape_once to ERB::Util, and delegate escape_once tag helper to it. *Carlos Antonio da Silva*
|
2012-01-12 18:04:02 -05:00
|
|
|
|
2012-05-09 08:40:08 -04:00
|
|
|
* Deprecates the compatibility method Module#local_constant_names,
|
|
|
|
use Module#local_constants instead (which returns symbols). *fxn*
|
2012-01-12 15:17:24 -05:00
|
|
|
|
2012-05-09 08:40:08 -04:00
|
|
|
* Deletes the compatibility method Module#method_names,
|
|
|
|
use Module#methods from now on (which returns symbols). *fxn*
|
2011-12-25 14:11:23 -05:00
|
|
|
|
2012-05-09 08:40:08 -04:00
|
|
|
* Deletes the compatibility method Module#instance_method_names,
|
|
|
|
use Module#instance_methods from now on (which returns symbols). *fxn*
|
2011-12-25 14:02:42 -05:00
|
|
|
|
2012-05-09 08:40:08 -04:00
|
|
|
* BufferedLogger is deprecated. Use ActiveSupport::Logger, or the logger
|
|
|
|
from Ruby stdlib.
|
2011-12-19 21:41:37 -05:00
|
|
|
|
2012-05-09 08:40:08 -04:00
|
|
|
* Unicode database updated to 6.1.0.
|
2012-02-03 08:20:25 -05:00
|
|
|
|
2012-05-09 08:40:08 -04:00
|
|
|
* Adds `encode_big_decimal_as_string` option to force JSON serialization of BigDecimals as numeric instead
|
|
|
|
of wrapping them in strings for safety.
|
2012-04-28 17:44:51 -04:00
|
|
|
|
2012-05-30 13:18:29 -04:00
|
|
|
* Remove deprecated ActiveSupport::JSON::Variable. *Erich Menge*
|
|
|
|
|
2012-09-19 19:00:28 -04:00
|
|
|
* Optimize log subscribers to check log level before doing any processing. *Brian Durand*
|
|
|
|
|
2012-08-28 15:15:12 -04:00
|
|
|
Please check [3-2-stable](https://github.com/rails/rails/blob/3-2-stable/activesupport/CHANGELOG.md) for previous changes.
|