Start Rails 5 development 🎉

We will support only Ruby >= 2.1.

But right now we don't accept pull requests with syntax changes to drop
support to Ruby 1.9.
This commit is contained in:
Rafael Mendonça França 2014-11-28 15:00:06 -02:00
parent ee614af6fa
commit f25ad07f5a
20 changed files with 37 additions and 2746 deletions

View File

@ -16,18 +16,12 @@ env:
- "GEM=ar:postgresql"
- "GEM=aj:integration"
rvm:
- 1.9.3
- 2.0.0
- 2.1
- ruby-head
- rbx-2
- jruby
matrix:
allow_failures:
- rvm: 1.9.3
env: "GEM=ar:mysql"
- rvm: 2.0.0
env: "GEM=ar:mysql"
- rvm: ruby-head
env: "GEM=ar:mysql"
- rvm: rbx-2

View File

@ -1 +1 @@
4.2.0.beta4
5.0.0.alpha

View File

@ -1,63 +1 @@
* `MailerGenerator` now generates layouts by default. The HTML mailer layout
now includes `<html>` and `<body>` tags which improve the spam rating in
some spam detection engines. Mailers now inherit from `ApplicationMailer`
which sets the default layout.
*Andy Jeffries*
* `link_to` and `url_for` now generate URLs by default in templates.
Passing `only_path: false` is no longer needed.
Fixes #16497 and #16589.
*Xavier Noria*, *Richard Schneeman*
* Attachments can now be added while rendering the mail template.
Fixes #16974.
*Christian Felder*
* Add `#deliver_later` and `#deliver_now` methods and deprecate `#deliver` in
favor of `#deliver_now`. `#deliver_later` will enqueue a job to render and
deliver the mail instead of delivering it immediately. The job is enqueued
using the new Active Job framework in Rails and will use the queue that you
have configured in Rails.
*DHH*, *Abdelkader Boudih*, *Cristian Bica*
* `ActionMailer::Previews` are now class methods instead of instance methods.
*Cristian Bica*
* Deprecate `*_path` helpers in email views. They generated broken links in
email views and were not the intention of most developers. The `*_url`
helper is recommended instead.
*Richard Schneeman*
* Raise an exception when attachments are added after `mail` is called.
This is a safeguard to prevent invalid emails.
Fixes #16163.
*Yves Senn*
* Add `config.action_mailer.show_previews` configuration option.
This configuration option can be used to enable the mail preview in
environments other than development (such as staging).
Defaults to `true` in development and `false` elsewhere.
*Leonard Garvey*
* Allow preview interceptors to be registered through
`config.action_mailer.preview_interceptors`.
See #15739.
*Yves Senn*
Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/actionmailer/CHANGELOG.md)
for previous changes.
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/actionmailer/CHANGELOG.md) for previous changes.

View File

@ -5,10 +5,10 @@ module ActionMailer
end
module VERSION
MAJOR = 4
MINOR = 2
MAJOR = 5
MINOR = 0
TINY = 0
PRE = "beta4"
PRE = "alpha"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end

View File

@ -1,410 +1 @@
* Restore handling of a bare `Authorization` header, without `token=`
prefix.
Fixes #17108.
*Guo Xiang Tan*
* Deprecate use of string keys in URL helpers.
Use symbols instead.
Fixes #16958.
*Byron Bischoff*, *Melanie Gilman*
* Deprecate the `only_path` option on `*_path` helpers.
In cases where this option is set to `true`, the option is redundant and can
be safely removed; otherwise, the corresponding `*_url` helper should be
used instead.
Fixes #17294.
*Dan Olson*, *Godfrey Chan*
* Improve Journey compliance to RFC 3986.
The scanner in Journey failed to recognize routes that use literals
from the sub-delims section of RFC 3986. It's now able to parse those
authorized delimiters and route as expected.
Fixes #17212.
*Nicolas Cavigneaux*
* Deprecate implicit Array conversion for Response objects. It was added
(using `#to_ary`) so we could conveniently use implicit splatting:
status, headers, body = response
But it also means `response + response` works and `[response].flatten`
cascades down to the Rack body. Nonsense behavior. Instead, rely on
explicit conversion and splatting with `#to_a`:
status, header, body = *response
*Jeremy Kemper*
* Don't rescue `IPAddr::InvalidAddressError`.
`IPAddr::InvalidAddressError` does not exist in Ruby 1.9.3
and fails for JRuby in 1.9 mode.
*Peter Suschlik*
* Fix bug where the router would ignore any constraints added to redirect
routes.
Fixes #16605.
*Agis Anastasopoulos*
* Allow `config.action_dispatch.trusted_proxies` to accept an IPAddr object.
Example:
# config/environments/production.rb
config.action_dispatch.trusted_proxies = IPAddr.new('4.8.15.0/16')
*Sam Aarons*
* Avoid duplicating routes for HEAD requests.
Instead of duplicating the routes, we will first match the HEAD request to
HEAD routes. If no match is found, we will then map the HEAD request to
GET routes.
*Guo Xiang Tan*, *Andrew White*
* Requests that hit `ActionDispatch::Static` can now take advantage
of gzipped assets on disk. By default a gzip asset will be served if
the client supports gzip and a compressed file is on disk.
*Richard Schneeman*
* `ActionController::Parameters` will stop inheriting from `Hash` and
`HashWithIndifferentAccess` in the next major release. If you use any method
that is not available on `ActionController::Parameters` you should consider
calling `#to_h` to convert it to a `Hash` first before calling that method.
*Prem Sichanugrist*
* `ActionController::Parameters#to_h` now returns a `Hash` with unpermitted
keys removed. This change is to reflect on a security concern where some
method performed on an `ActionController::Parameters` may yield a `Hash`
object which does not maintain `permitted?` status. If you would like to
get a `Hash` with all the keys intact, duplicate and mark it as permitted
before calling `#to_h`.
params = ActionController::Parameters.new({
name: 'Senjougahara Hitagi',
oddity: 'Heavy stone crab'
})
params.to_h
# => {}
unsafe_params = params.dup.permit!
unsafe_params.to_h
# => {"name"=>"Senjougahara Hitagi", "oddity"=>"Heavy stone crab"}
safe_params = params.permit(:name)
safe_params.to_h
# => {"name"=>"Senjougahara Hitagi"}
This change is consider a stopgap as we cannot change the code to stop
`ActionController::Parameters` to inherit from `HashWithIndifferentAccess`
in the next minor release.
*Prem Sichanugrist*
* Deprecated `TagAssertions`.
*Kasper Timm Hansen*
* Use the Active Support JSON encoder for cookie jars using the `:json` or
`:hybrid` serializer. This allows you to serialize custom Ruby objects into
cookies by defining the `#as_json` hook on such objects.
Fixes #16520.
*Godfrey Chan*
* Add `config.action_dispatch.cookies_digest` option for setting custom
digest. The default remains the same - 'SHA1'.
*Łukasz Strzałkowski*
* Move `respond_with` (and the class-level `respond_to`) to
the `responders` gem.
*José Valim*
* When your templates change, browser caches bust automatically.
New default: the template digest is automatically included in your ETags.
When you call `fresh_when @post`, the digest for `posts/show.html.erb`
is mixed in so future changes to the HTML will blow HTTP caches for you.
This makes it easy to HTTP-cache many more of your actions.
If you render a different template, you can now pass the `:template`
option to include its digest instead:
fresh_when @post, template: 'widgets/show'
Pass `template: false` to skip the lookup. To turn this off entirely, set:
config.action_controller.etag_with_template_digest = false
*Jeremy Kemper*
* Remove deprecated `AbstractController::Helpers::ClassMethods::MissingHelperError`
in favor of `AbstractController::Helpers::MissingHelperError`.
*Yves Senn*
* Fix `assert_template` not being able to assert that no files were rendered.
*Guo Xiang Tan*
* Extract source code for the entire exception stack trace for
better debugging and diagnosis.
*Ryan Dao*
* Allows ActionDispatch::Request::LOCALHOST to match any IPv4 127.0.0.0/8
loopback address.
*Earl St Sauver*, *Sven Riedel*
* Preserve original path in `ShowExceptions` middleware by stashing it as
`env["action_dispatch.original_path"]`
`ActionDispatch::ShowExceptions` overwrites `PATH_INFO` with the status code
for the exception defined in `ExceptionWrapper`, so the path
the user was visiting when an exception occurred was not previously
available to any custom exceptions_app. The original `PATH_INFO` is now
stashed in `env["action_dispatch.original_path"]`.
*Grey Baker*
* Use `String#bytesize` instead of `String#size` when checking for cookie
overflow.
*Agis Anastasopoulos*
* `render nothing: true` or rendering a `nil` body no longer add a single
space to the response body.
The old behavior was added as a workaround for a bug in an early version of
Safari, where the HTTP headers are not returned correctly if the response
body has a 0-length. This is been fixed since and the workaround is no
longer necessary.
Use `render body: ' '` if the old behavior is desired.
See #14883 for details.
*Godfrey Chan*
* Prepend a JS comment to JSONP callbacks. Addresses CVE-2014-4671
("Rosetta Flash").
*Greg Campbell*
* Because URI paths may contain non US-ASCII characters we need to force
the encoding of any unescaped URIs to UTF-8 if they are US-ASCII.
This essentially replicates the functionality of the monkey patch to
URI.parser.unescape in active_support/core_ext/uri.rb.
Fixes #16104.
*Karl Entwistle*
* Generate shallow paths for all children of shallow resources.
Fixes #15783.
*Seb Jacobs*
* JSONP responses are now rendered with the `text/javascript` content type
when rendering through a `respond_to` block.
Fixes #15081.
*Lucas Mazza*
* Add `config.action_controller.always_permitted_parameters` to configure which
parameters are permitted globally. The default value of this configuration is
`['controller', 'action']`.
*Gary S. Weaver*, *Rafael Chacon*
* Fix env['PATH_INFO'] missing leading slash when a rack app mounted at '/'.
Fixes #15511.
*Larry Lv*
* ActionController::Parameters#require now accepts `false` values.
Fixes #15685.
*Sergio Romano*
* With authorization header `Authorization: Token token=`, `authenticate` now
recognize token as nil, instead of "token".
Fixes #14846.
*Larry Lv*
* Ensure the controller is always notified as soon as the client disconnects
during live streaming, even when the controller is blocked on a write.
*Nicholas Jakobsen*, *Matthew Draper*
* Routes specifying 'to:' must be a string that contains a "#" or a rack
application. Use of a symbol should be replaced with `action: symbol`.
Use of a string without a "#" should be replaced with `controller: string`.
*Aaron Patterson*
* Fix URL generation with `:trailing_slash` such that it does not add
a trailing slash after `.:format`
*Dan Langevin*
* Build full URI as string when processing path in integration tests for
performance reasons.
*Guo Xiang Tan*
* Fix `'Stack level too deep'` when rendering `head :ok` in an action method
called 'status' in a controller.
Fixes #13905.
*Christiaan Van den Poel*
* Add MKCALENDAR HTTP method (RFC 4791).
*Sergey Karpesh*
* Instrument fragment cache metrics.
Adds `:controller`: and `:action` keys to the instrumentation payload
for the `*_fragment.action_controller` notifications. This allows tracking
e.g. the fragment cache hit rates for each controller action.
*Daniel Schierbeck*
* Always use the provided port if the protocol is relative.
Fixes #15043.
*Guilherme Cavalcanti*, *Andrew White*
* Moved `params[request_forgery_protection_token]` into its own method
and improved tests.
Fixes #11316.
*Tom Kadwill*
* Added verification of route constraints given as a Proc or an object responding
to `:matches?`. Previously, when given an non-complying object, it would just
silently fail to enforce the constraint. It will now raise an `ArgumentError`
when setting up the routes.
*Xavier Defrang*
* Properly treat the entire IPv6 User Local Address space as private for
purposes of remote IP detection. Also handle uppercase private IPv6
addresses.
Fixes #12638.
*Caleb Spare*
* Fixed an issue with migrating legacy json cookies.
Previously, the `VerifyAndUpgradeLegacySignedMessage` assumes all incoming
cookies are marshal-encoded. This is not the case when `secret_token` is
used in conjunction with the `:json` or `:hybrid` serializer.
In those case, when upgrading to use `secret_key_base`, this would cause a
`TypeError: incompatible marshal file format` and a 500 error for the user.
Fixes #14774.
*Godfrey Chan*
* Make URL escaping more consistent:
1. Escape '%' characters in URLs - only unescaped data should be passed to URL helpers
2. Add an `escape_segment` helper to `Router::Utils` that escapes '/' characters
3. Use `escape_segment` rather than `escape_fragment` in optimized URL generation
4. Use `escape_segment` rather than `escape_path` in URL generation
For point 4 there are two exceptions. Firstly, when a route uses wildcard segments
(e.g. `*foo`) then we use `escape_path` as the value may contain '/' characters. This
means that wildcard routes can't be optimized. Secondly, if a `:controller` segment
is used in the path then this uses `escape_path` as the controller may be namespaced.
Fixes #14629, #14636 and #14070.
*Andrew White*, *Edho Arief*
* Add alias `ActionDispatch::Http::UploadedFile#to_io` to
`ActionDispatch::Http::UploadedFile#tempfile`.
*Tim Linquist*
* Returns null type format when format is not know and controller is using `any`
format block.
Fixes #14462.
*Rafael Mendonça França*
* Improve routing error page with fuzzy matching search.
*Winston*
* Only make deeply nested routes shallow when parent is shallow.
Fixes #14684.
*Andrew White*, *James Coglan*
* Append link to bad code to backtrace when exception is `SyntaxError`.
*Boris Kuznetsov*
* Swapped the parameters of assert_equal in `assert_select` so that the
proper values were printed correctly.
Fixes #14422.
*Vishal Lal*
* The method `shallow?` returns false if the parent resource is a singleton so
we need to check if we're not inside a nested scope before copying the :path
and :as options to their shallow equivalents.
Fixes #14388.
*Andrew White*
* Make logging of CSRF failures optional (but on by default) with the
`log_warning_on_csrf_failure` configuration setting in
`ActionController::RequestForgeryProtection`.
*John Barton*
* Fix URL generation in controller tests with request-dependent
`default_url_options` methods.
*Tony Wooster*
Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/actionpack/CHANGELOG.md) for previous changes.
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/actionpack/CHANGELOG.md) for previous changes.

View File

@ -5,10 +5,10 @@ module ActionPack
end
module VERSION
MAJOR = 4
MINOR = 2
MAJOR = 5
MINOR = 0
TINY = 0
PRE = "beta4"
PRE = "alpha"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end

View File

@ -1,218 +1 @@
* Local variable in a partial is now available even if a falsy value is
passed to `:object` when rendering a partial.
Fixes #17373.
*Agis Anastasopoulos*
* Add support for `:enforce_utf8` option in `form_for`.
This is the same option that was added in 06388b0 to `form_tag` and allows
users to skip the insertion of the UTF8 enforcer tag in a form.
* claudiob *
* Fix a bug that <%= foo(){ %> and <%= foo()do %> in view templates were not regarded
as Ruby block calls.
* Akira Matsuda *
* Update `select_tag` to work correctly with `:include_blank` option passing a string.
Fixes #16483.
*Frank Groeneveld*
* Changed the meaning of `render "foo/bar"`.
Previously, calling `render "foo/bar"` in a controller action is equivalent
to `render file: "foo/bar"`. In Rails 4.2, this has been changed to mean
`render template: "foo/bar"` instead. If you need to render a file, please
change your code to use the explicit form (`render file: "foo/bar"`) instead.
*Jeremy Jackson*
* Add support for ARIA attributes in tags.
Example:
<%= f.text_field :name, aria: { required: "true", hidden: "false" } %>
now generates:
<input aria-hidden="false" aria-required="true" id="user_name" name="user[name]" type="text">
*Paola Garcia Casadiego*
* Provide a `builder` object when using the `label` form helper in block form.
The new `builder` object responds to `translation`, allowing I18n fallback support
when you want to customize how a particular label is presented.
*Alex Robbin*
* Add I18n support for input/textarea placeholder text.
Placeholder I18n follows the same convention as `label` I18n.
*Alex Robbin*
* Fix that render layout: 'messages/layout' should also be added to the dependency tracker tree.
*DHH*
* Add `PartialIteration` object used when rendering collections.
The iteration object is available as the local variable
`#{template_name}_iteration` when rendering partials with collections.
It gives access to the `size` of the collection being iterated over,
the current `index` and two convenience methods `first?` and `last?`.
*Joel Junström*, *Lucas Uyezu*
* Return an absolute instead of relative path from an asset url in the case
of the `asset_host` proc returning nil.
*Jolyon Pawlyn*
* Fix `html_escape_once` to properly handle hex escape sequences (e.g. &#x1a2b;).
*John F. Douthat*
* Added String support for min and max properties for date field helpers.
*Todd Bealmear*
* The `highlight` helper now accepts a block to be used instead of the `highlighter`
option.
*Lucas Mazza*
* The `except` and `highlight` helpers now accept regular expressions.
*Jan Szumiec*
* Flatten the array parameter in `safe_join`, so it behaves consistently with
`Array#join`.
*Paul Grayson*
* Honor `html_safe` on array elements in tag values, as we do for plain string
values.
*Paul Grayson*
* Add `ActionView::Template::Handler.unregister_template_handler`.
It performs the opposite of `ActionView::Template::Handler.register_template_handler`.
*Zuhao Wan*
* Bring `cache_digest` rake tasks up-to-date with the latest API changes.
*Jiri Pospisil*
* Allow custom `:host` option to be passed to `asset_url` helper that
overwrites `config.action_controller.asset_host` for particular asset.
*Hubert Łępicki*
* Deprecate `AbstractController::Base.parent_prefixes`.
Override `AbstractController::Base.local_prefixes` when you want to change
where to find views.
*Nick Sutterer*
* Take label values into account when doing I18n lookups for model attributes.
The following:
# form.html.erb
<%= form_for @post do |f| %>
<%= f.label :type, value: "long" %>
<% end %>
# en.yml
en:
activerecord:
attributes:
post/long: "Long-form Post"
Used to simply return "long", but now it will return "Long-form
Post".
*Joshua Cody*
* Change `asset_path` to use File.join to create proper paths:
Before:
https://some.host.com//assets/some.js
After:
https://some.host.com/assets/some.js
*Peter Schröder*
* Change `favicon_link_tag` default mimetype from `image/vnd.microsoft.icon` to
`image/x-icon`.
Before:
# => favicon_link_tag 'myicon.ico'
<link href="/assets/myicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
After:
# => favicon_link_tag 'myicon.ico'
<link href="/assets/myicon.ico" rel="shortcut icon" type="image/x-icon" />
*Geoffroy Lorieux*
* Remove wrapping div with inline styles for hidden form fields.
We are dropping HTML 4.01 and XHTML strict compliance since input tags directly
inside a form are valid HTML5, and the absence of inline styles help in validating
for Content Security Policy.
*Joost Baaij*
* `collection_check_boxes` respects `:index` option for the hidden field name.
Fixes #14147.
*Vasiliy Ermolovich*
* `date_select` helper with option `with_css_classes: true` does not overwrite other classes.
*Izumi Wong-Horiuchi*
* `number_to_percentage` does not crash with `Float::NAN` or `Float::INFINITY`
as input.
Fixes #14405.
*Yves Senn*
* Add `include_hidden` option to `collection_check_boxes` helper.
*Vasiliy Ermolovich*
* Fixed a problem where the default options for the `button_tag` helper are not
applied correctly.
Fixes #14254.
*Sergey Prikhodko*
* Take variants into account when calculating template digests in ActionView::Digestor.
The arguments to ActionView::Digestor#digest are now being passed as a hash
to support variants and allow more flexibility in the future. The support for
regular (required) arguments is deprecated and will be removed in Rails 5.0 or later.
*Piotr Chmolowski, Łukasz Strzałkowski*
Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/actionview/CHANGELOG.md) for previous changes.
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/actionview/CHANGELOG.md) for previous changes.

View File

@ -5,10 +5,10 @@ module ActionView
end
module VERSION
MAJOR = 4
MINOR = 2
MAJOR = 5
MINOR = 0
TINY = 0
PRE = "beta4"
PRE = "alpha"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end

View File

@ -1 +1 @@
* Started project.
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/activejob/CHANGELOG.md) for previous changes.

View File

@ -5,10 +5,10 @@ module ActiveJob
end
module VERSION
MAJOR = 4
MINOR = 2
MAJOR = 5
MINOR = 0
TINY = 0
PRE = "beta4"
PRE = "alpha"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end

View File

@ -1,61 +1 @@
* Passwords with spaces only allowed in `ActiveModel::SecurePassword`.
Presence validation can be used to restore old behavior.
*Yevhene Shemet*
* Validate options passed to `ActiveModel::Validations.validate`.
Preventing, in many cases, the simple mistake of using `validate` instead of `validates`.
*Sonny Michaud*
* Deprecate `reset_#{attribute}` in favor of `restore_#{attribute}`.
These methods may cause confusion with the `reset_changes`, which has
different behaviour.
*Rafael Mendonça França*
* Deprecate `ActiveModel::Dirty#reset_changes` in favor of `#clear_changes_information`.
Method's name is causing confusion with the `reset_#{attribute}` methods.
While `reset_name` sets the value of the name attribute to previous value
`reset_changes` only discards the changes.
*Rafael Mendonça França*
* Added `restore_attributes` method to `ActiveModel::Dirty` API which restores
the value of changed attributes to previous value.
*Igor G.*
* Allow proc and symbol as values for `only_integer` of `NumericalityValidator`
*Robin Mehner*
* `has_secure_password` now verifies that the given password is less than 72
characters if validations are enabled.
Fixes #14591.
*Akshay Vishnoi*
* Remove deprecated `Validator#setup` without replacement.
See #10716.
*Kuldeep Aggarwal*
* Add plural and singular form for length validator's default messages.
*Abd ar-Rahman Hamid*
* Introduce `validate` as an alias for `valid?`.
This is more intuitive when you want to run validations but don't care about
the return value.
*Henrik Nyh*
Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/activemodel/CHANGELOG.md) for previous changes.
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/activemodel/CHANGELOG.md) for previous changes.

View File

@ -5,10 +5,10 @@ module ActiveModel
end
module VERSION
MAJOR = 4
MINOR = 2
MAJOR = 5
MINOR = 0
TINY = 0
PRE = "beta4"
PRE = "alpha"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end

File diff suppressed because it is too large Load Diff

View File

@ -5,10 +5,10 @@ module ActiveRecord
end
module VERSION
MAJOR = 4
MINOR = 2
MAJOR = 5
MINOR = 0
TINY = 0
PRE = "beta4"
PRE = "alpha"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end

View File

@ -1,388 +1 @@
* The decorated `load` and `require` methods are now kept private.
Fixes #17553.
*Xavier Noria*
* `String#remove` and `String#remove!` accept multiple arguments.
*Pavel Pravosud*
* `TimeWithZone#strftime` now delegates every directive to `Time#strftime` except for '%Z',
it also now correctly handles escaped '%' characters placed just before time zone related directives.
*Pablo Herrero*
* Corrected `Inflector#underscore` handling of multiple successive acroynms.
*James Le Cuirot*
* Delegation now works with ruby reserved words passed to `:to` option.
Fixes #16956.
*Agis Anastasopoulos*
* Added method `#eql?` to `ActiveSupport::Duration`, in addition to `#==`.
Currently, the following returns `false`, contrary to expectation:
1.minute.eql?(1.minute)
Adding method `#eql?` will make this behave like expected. Method `#eql?` is
just a bit stricter than `#==`, as it checks whether the argument is also a duration. Their
parts may be different though.
1.minute.eql?(60.seconds) # => true
1.minute.eql?(60) # => false
*Joost Lubach*
* `Time#change` can now change nanoseconds (`:nsec`) as a higher-precision
alternative to microseconds (`:usec`).
*Agis Anastasooulos*
* `MessageVerifier.new` raises an appropriate exception if the secret is `nil`.
This prevents `MessageVerifier#generate` from raising a cryptic error later on.
*Kostiantyn Kahanskyi*
* Introduced new configuration option `active_support.test_order` for
specifying the order in which test cases are executed. This option currently defaults
to `:sorted` but will be changed to `:random` in Rails 5.0.
*Akira Matsuda*, *Godfrey Chan*
* Fixed a bug in `Inflector#underscore` where acroynms in nested constant names
are incorrectly parsed as camelCase.
Fixes #8015.
*Fred Wu*, *Matthew Draper*
* Make `Time#change` throw an exception if the `:usec` option is out of range and
the time has an offset other than UTC or local.
*Agis Anastasopoulos*
* `Method` objects now report themselves as not `duplicable?`. This allows
hashes and arrays containing `Method` objects to be `deep_dup`ed.
*Peter Jaros*
* `determine_constant_from_test_name` does no longer shadow `NameError`s
which happens during constant autoloading.
Fixes #9933.
*Guo Xiang Tan*
* Added instance_eval version to Object#try and Object#try!, so you can do this:
person.try { name.first }
instead of:
person.try { |person| person.name.first }
*DHH*, *Ari Pollak*
* Fix the `ActiveSupport::Duration#instance_of?` method to return the right
value with the class itself since it was previously delegated to the
internal value.
*Robin Dupret*
* Fix rounding errors with `#travel_to` by resetting the usec on any passed time to zero, so we only travel
with per-second precision, not anything deeper than that.
*DHH*
* Fix DateTime comparison with `DateTime::Infinity` object.
*Rafael Mendonça França*
* Added Object#itself which returns the object itself. Useful when dealing with a chaining scenario, like Active Record scopes:
Event.public_send(state.presence_in([ :trashed, :drafted ]) || :itself).order(:created_at)
*DHH*
* `Object#with_options` executes block in merging option context when
explicit receiver in not passed.
*Pavel Pravosud*
* Fixed a compatibility issue with the `Oj` gem when cherry-picking the file
`active_support/core_ext/object/json` without requiring `active_support/json`.
Fixes #16131.
*Godfrey Chan*
* Make `Hash#with_indifferent_access` copy the default proc too.
*arthurnn*, *Xanders*
* Add `String#truncate_words` to truncate a string by a number of words.
*Mohamed Osama*
* Deprecate `capture` and `quietly`.
These methods are not thread safe and may cause issues when used in threaded environments.
To avoid problems we are deprecating them.
*Tom Meier*
* `DateTime#to_f` now preserves the fractional seconds instead of always
rounding to `.0`.
Fixes #15994.
*John Paul Ashenfelter*
* Add `Hash#transform_values` to simplify a common pattern where the values of a
hash must change, but the keys are left the same.
*Sean Griffin*
* Always instrument `ActiveSupport::Cache`.
Since `ActiveSupport::Notifications` only instruments items when there
are attached subscribers, we don't need to disable instrumentation.
*Peter Wagenet*
* Make the `apply_inflections` method case-insensitive when checking
whether a word is uncountable or not.
*Robin Dupret*
* Make Dependencies pass a name to NameError error.
*arthurnn*
* Fixed `ActiveSupport::Cache::FileStore` exploding with long paths.
*Adam Panzer*, *Michael Grosser*
* Fixed `ActiveSupport::TimeWithZone#-` so precision is not unnecessarily lost
when working with objects with a nanosecond component.
`ActiveSupport::TimeWithZone#-` should return the same result as if we were
using `Time#-`:
Time.now.end_of_day - Time.now.beginning_of_day # => 86399.999999999
Before:
Time.zone.now.end_of_day.nsec # => 999999999
Time.zone.now.end_of_day - Time.zone.now.beginning_of_day # => 86400.0
After:
Time.zone.now.end_of_day - Time.zone.now.beginning_of_day
# => 86399.999999999
*Gordon Chan*
* Fixed precision error in NumberHelper when using Rationals.
Before:
ActiveSupport::NumberHelper.number_to_rounded Rational(1000, 3), precision: 2
# => "330.00"
After:
ActiveSupport::NumberHelper.number_to_rounded Rational(1000, 3), precision: 2
# => "333.33"
See #15379.
*Juanjo Bazán*
* Removed deprecated `Numeric#ago` and friends
Replacements:
5.ago => 5.seconds.ago
5.until => 5.seconds.until
5.since => 5.seconds.since
5.from_now => 5.seconds.from_now
See #12389 for the history and rationale behind this.
*Godfrey Chan*
* DateTime `advance` now supports partial days.
Before:
DateTime.now.advance(days: 1, hours: 12)
After:
DateTime.now.advance(days: 1.5)
Fixes #12005.
*Shay Davidson*
* `Hash#deep_transform_keys` and `Hash#deep_transform_keys!` now transform hashes
in nested arrays. This change also applies to `Hash#deep_stringify_keys`,
`Hash#deep_stringify_keys!`, `Hash#deep_symbolize_keys` and
`Hash#deep_symbolize_keys!`.
*OZAWA Sakuro*
* Fixed confusing `DelegationError` in `Module#delegate`.
See #15186.
*Vladimir Yarotsky*
* Fixed `ActiveSupport::Subscriber` so that no duplicate subscriber is created
when a subscriber method is redefined.
*Dennis Schön*
* Remove deprecated string based terminators for `ActiveSupport::Callbacks`.
*Eileen M. Uchitelle*
* Fixed an issue when using
`ActiveSupport::NumberHelper::NumberToDelimitedConverter` to
convert a value that is an `ActiveSupport::SafeBuffer` introduced
in 2da9d67.
See #15064.
*Mark J. Titorenko*
* `TimeZone#parse` defaults the day of the month to '1' if any other date
components are specified. This is more consistent with the behavior of
`Time#parse`.
*Ulysse Carion*
* `humanize` strips leading underscores, if any.
Before:
'_id'.humanize # => ""
After:
'_id'.humanize # => "Id"
*Xavier Noria*
* Fixed backward compatibility issues introduced in 326e652.
Empty Hash or Array should not be present in serialization result.
{a: []}.to_query # => ""
{a: {}}.to_query # => ""
For more info see #14948.
*Bogdan Gusiev*
* Add `Digest::UUID::uuid_v3` and `Digest::UUID::uuid_v5` to support stable
UUID fixtures on PostgreSQL.
*Roderick van Domburg*
* Fixed `ActiveSupport::Duration#eql?` so that `1.second.eql?(1.second)` is
true.
This fixes the current situation of:
1.second.eql?(1.second) # => false
`eql?` also requires that the other object is an `ActiveSupport::Duration`.
This requirement makes `ActiveSupport::Duration`'s behavior consistent with
the behavior of Ruby's numeric types:
1.eql?(1.0) # => false
1.0.eql?(1) # => false
1.second.eql?(1) # => false (was true)
1.eql?(1.second) # => false
{ 1 => "foo", 1.0 => "bar" }
# => { 1 => "foo", 1.0 => "bar" }
{ 1 => "foo", 1.second => "bar" }
# now => { 1 => "foo", 1.second => "bar" }
# was => { 1 => "bar" }
And though the behavior of these hasn't changed, for reference:
1 == 1.0 # => true
1.0 == 1 # => true
1 == 1.second # => true
1.second == 1 # => true
*Emily Dobervich*
* `ActiveSupport::SafeBuffer#prepend` acts like `String#prepend` and modifies
instance in-place, returning self. `ActiveSupport::SafeBuffer#prepend!` is
deprecated.
*Pavel Pravosud*
* `HashWithIndifferentAccess` better respects `#to_hash` on objects it
receives. In particular, `.new`, `#update`, `#merge`, and `#replace` accept
objects which respond to `#to_hash`, even if those objects are not hashes
directly.
*Peter Jaros*
* Deprecate `Class#superclass_delegating_accessor`, use `Class#class_attribute` instead.
*Akshay Vishnoi*
* Ensure classes which `include Enumerable` get `#to_json` in addition to
`#as_json`.
*Sammy Larbi*
* Change the signature of `fetch_multi` to return a hash rather than an
array. This makes it consistent with the output of `read_multi`.
*Parker Selbert*
* Introduce `Concern#class_methods` as a sleek alternative to clunky
`module ClassMethods`. Add `Kernel#concern` to define at the toplevel
without chunky `module Foo; extend ActiveSupport::Concern` boilerplate.
# app/models/concerns/authentication.rb
concern :Authentication do
included do
after_create :generate_private_key
end
class_methods do
def authenticate(credentials)
# ...
end
end
def generate_private_key
# ...
end
end
# app/models/user.rb
class User < ActiveRecord::Base
include Authentication
end
*Jeremy Kemper*
Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/activesupport/CHANGELOG.md) for previous changes.
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/activesupport/CHANGELOG.md) for previous changes.

View File

@ -5,10 +5,10 @@ module ActiveSupport
end
module VERSION
MAJOR = 4
MINOR = 2
MAJOR = 5
MINOR = 0
TINY = 0
PRE = "beta4"
PRE = "alpha"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end

View File

@ -1,27 +1 @@
* Change Posts to Articles in Getting Started sample application in order to
better align with the actual guides.
*John Kelly Ferguson*
* Update all Rails 4.1.0 references to 4.1.1 within the guides and code.
*John Kelly Ferguson*
* Split up rows in the Explain Queries table of the ActiveRecord Querying section
in order to improve readability.
*John Kelly Ferguson*
* Change all non-HTTP method 'post' references to 'article'.
*John Kelly Ferguson*
* Updates the maintenance policy to match the latest versions of Rails
*Matias Korhonen*
* Switched the order of `Applying a default scope` and `Merging of scopes` subsections so default scopes are introduced first.
*Alex Riabov*
Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/guides/CHANGELOG.md) for previous changes.
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/guides/CHANGELOG.md) for previous changes.

View File

@ -1,208 +1 @@
* Generated migrations add the appropriate foreign key constraints to
references.
*Derek Prior*
* Deprecate different default for `log_level` in production.
*Godfrey Chan*, *Matthew Draper*
* Generated `.gitignore` excludes the whole `log/` directory, not only
`*.log` files.
*ShunsukeAida*
* `Rails::Paths::Path.unshift` now has the same interface as `Array.unshift`.
*Igor Kapkov*
* Make `rake test` run all tests in test folder.
Deprecate `rake test:all` and replace `rake test:all:db` with `rake test:db`
*David Geukers*
* `secret_token` is now saved in `Rails.application.secrets.secret_token`
and it falls back to the value of `config.secret_token` when it is not
present in `config/secrets.yml`.
*Benjamin Fleischer*
* Remove `--skip-action-view` option from `Rails::Generators::AppBase`.
Fixes #17023.
*Dan Olson*
* Specify dummy app's db migrate path in plugin's test_helper.rb.
Fixes #16877.
*Yukio Mizuta*
* Inject `Rack::Lock` if `config.eager_load` is false.
Fixes #15089.
*Xavier Noria*
* Change the path of dummy app location in plugin's test_helper.rb for cases
you specify dummy_path option.
*Yukio Mizuta*
* Fix a bug in the `gem` method for Rails templates when non-String options
are used.
Fixes #16709.
*Yves Senn*
* The [web-console](https://github.com/rails/web-console) gem is now
installed by default for new applications. It can help you debug
development exceptions by spawning an interactive console in its cause
binding.
*Ryan Dao*, *Genadi Samokovarov*, *Guillermo Iguaran*
* Add a `required` option to the model generator for associations
*Sean Griffin*
* Add `after_bundle` callbacks in Rails templates. Useful for allowing the
generated binstubs to be added to version control.
Fixes #16292.
*Stefan Kanev*
* Pull in the custom configuration concept from dhh/custom_configuration, which allows you to
configure your own code through the Rails configuration object with custom configuration:
# config/environments/production.rb
config.x.payment_processing.schedule = :daily
config.x.payment_processing.retries = 3
config.x.super_debugger = true
These configuration points are then available through the configuration object:
Rails.configuration.x.payment_processing.schedule # => :daily
Rails.configuration.x.payment_processing.retries # => 3
Rails.configuration.x.super_debugger # => true
*DHH*
* Scaffold generator `_form` partial adds `class="field"` for password
confirmation fields.
*noinkling*
* Add `Rails::Application.config_for` to load a configuration for the current
environment.
# config/exception_notification.yml:
production:
url: http://127.0.0.1:8080
namespace: my_app_production
development:
url: http://localhost:3001
namespace: my_app_development
# config/production.rb
Rails.application.configure do
config.middleware.use ExceptionNotifier, config_for(:exception_notification)
end
*Rafael Mendonça França*, *DHH*
* Deprecate `Rails::Rack::LogTailer` without replacement.
*Rafael Mendonça França*
* Add `--skip-turbolinks` option to the app generator.
*Rafael Mendonça França*
* Invalid `bin/rails generate` commands will now show spelling suggestions.
*Richard Schneeman*
* Add `bin/setup` script to bootstrap an application.
*Yves Senn*
* Replace double quotes with single quotes while adding an entry into Gemfile.
*Alexander Belaev*
* Default `config.assets.digest` to `true` in development.
*Dan Kang*
* Load database configuration from the first `database.yml` available in paths.
*Pier-Olivier Thibault*
* Reading name and email from git for plugin gemspec.
Fixes #9589.
*Arun Agrawal*, *Abd ar-Rahman Hamidi*, *Roman Shmatov*
* Fix `console` and `generators` blocks defined at different environments.
Fixes #14748.
*Rafael Mendonça França*
* Move configuration of asset precompile list and version to an initializer.
*Matthew Draper*
* Remove sqlite3 lines from `.gitignore` if the application is not using sqlite3.
*Dmitrii Golub*
* Add public API to register new extensions for `rake notes`.
Example:
config.annotations.register_extensions("scss", "sass") { |tag| /\/\/\s*(#{tag}):?\s*(.*)$/ }
*Roberto Miranda*
* Removed unnecessary `rails application` command.
*Arun Agrawal*
* Make the `rails:template` rake task load the application's initializers.
Fixes #12133.
*Robin Dupret*
* Introduce `Rails.gem_version` as a convenience method to return
`Gem::Version.new(Rails.version)`, suggesting a more reliable way to perform
version comparison.
Example:
Rails.version #=> "4.1.2"
Rails.gem_version #=> #<Gem::Version "4.1.2">
Rails.version > "4.1.10" #=> false
Rails.gem_version > Gem::Version.new("4.1.10") #=> true
Gem::Requirement.new("~> 4.1.2") =~ Rails.gem_version #=> true
*Prem Sichanugrist*
* Avoid namespacing routes inside engines.
Mountable engines are namespaced by default so the generated routes
were too while they should not.
Fixes #14079.
*Yves Senn*, *Carlos Antonio da Silva*, *Robin Dupret*
Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/railties/CHANGELOG.md) for previous changes.
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/railties/CHANGELOG.md) for previous changes.

View File

@ -5,10 +5,10 @@ module Rails
end
module VERSION
MAJOR = 4
MINOR = 2
MAJOR = 5
MINOR = 0
TINY = 0
PRE = "beta4"
PRE = "alpha"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end

View File

@ -5,10 +5,10 @@ module Rails
end
module VERSION
MAJOR = 4
MINOR = 2
MAJOR = 5
MINOR = 0
TINY = 0
PRE = "beta4"
PRE = "alpha"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end