2011-12-19 21:41:37 -05:00
|
|
|
## Rails 4.0.0 (unreleased) ##
|
|
|
|
|
2012-09-13 14:49:49 -04:00
|
|
|
* 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. *Pranas Kiziela*
|
|
|
|
|
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
|
|
|
* Remove ActiveSupport::TestCase#pending method, use `skip` instead. *Carlos Antonio da Silva*
|
2012-01-21 11:32:27 -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-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.
|