mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Start Rails 5.1 development 🎉
This commit is contained in:
parent
943b96c738
commit
8ecc5ab1d8
24 changed files with 101 additions and 5268 deletions
9
Gemfile
9
Gemfile
|
@ -11,7 +11,7 @@ gem 'mocha', '~> 0.14', require: false
|
|||
|
||||
gem 'rack-cache', '~> 1.2'
|
||||
gem 'jquery-rails'
|
||||
gem 'coffee-rails', '~> 4.1.0'
|
||||
gem 'coffee-rails', github: 'rails/coffee-rails'
|
||||
gem 'turbolinks', github: 'turbolinks/turbolinks-rails'
|
||||
|
||||
# require: false so bcrypt is loaded only when has_secure_password is used.
|
||||
|
@ -43,14 +43,15 @@ group :job do
|
|||
gem 'resque-scheduler', require: false
|
||||
gem 'sidekiq', require: false
|
||||
gem 'sucker_punch', require: false
|
||||
gem 'delayed_job', require: false
|
||||
gem 'delayed_job', require: false, github: 'collectiveidea/delayed_job'
|
||||
gem 'queue_classic', github: "QueueClassic/queue_classic", branch: 'master', require: false, platforms: :ruby
|
||||
gem 'sneakers', require: false
|
||||
gem 'que', require: false
|
||||
gem 'backburner', require: false
|
||||
gem 'qu-rails', github: "bkeepers/qu", branch: "master", require: false
|
||||
#TODO: add qu after it support Rails 5.1
|
||||
# gem 'qu-rails', github: "bkeepers/qu", branch: "master", require: false
|
||||
gem 'qu-redis', require: false
|
||||
gem 'delayed_job_active_record', require: false
|
||||
gem 'delayed_job_active_record', require: false, github: 'collectiveidea/delayed_job_active_record'
|
||||
gem 'sequel', require: false
|
||||
end
|
||||
|
||||
|
|
118
Gemfile.lock
118
Gemfile.lock
|
@ -7,21 +7,31 @@ GIT
|
|||
pg (>= 0.17, < 0.19)
|
||||
|
||||
GIT
|
||||
remote: git://github.com/bkeepers/qu.git
|
||||
revision: d098e2657c92e89a6413bebd9c033930759c061f
|
||||
branch: master
|
||||
remote: git://github.com/collectiveidea/delayed_job.git
|
||||
revision: 71f1d5faf934d3057abca942f0d410327bc69087
|
||||
specs:
|
||||
qu (0.2.0)
|
||||
qu-rails (0.2.0)
|
||||
qu (= 0.2.0)
|
||||
railties (>= 3.2, < 5)
|
||||
qu-redis (0.2.0)
|
||||
qu (= 0.2.0)
|
||||
redis-namespace
|
||||
delayed_job (4.1.1)
|
||||
activesupport (>= 3.0, < 5.1)
|
||||
|
||||
GIT
|
||||
remote: git://github.com/collectiveidea/delayed_job_active_record.git
|
||||
revision: 61e688e03b2ef4004b08de6d1e0a123fda8fffad
|
||||
specs:
|
||||
delayed_job_active_record (4.1.0)
|
||||
activerecord (>= 3.0, < 5.1)
|
||||
delayed_job (>= 3.0, < 5)
|
||||
|
||||
GIT
|
||||
remote: git://github.com/rails/coffee-rails.git
|
||||
revision: aa2e623cbda4f3c789a0a15d1f707239e68f5736
|
||||
specs:
|
||||
coffee-rails (4.1.1)
|
||||
coffee-script (>= 2.2.0)
|
||||
railties (>= 4.0.0, < 5.2.x)
|
||||
|
||||
GIT
|
||||
remote: git://github.com/sass/sass.git
|
||||
revision: 6e8a053f3f1b3c58d3c7db057d7df80e8fee3752
|
||||
revision: 3fda1cbe70d615e7ef96e28db4fd1f8a3ebb5505
|
||||
branch: stable
|
||||
specs:
|
||||
sass (3.4.22)
|
||||
|
@ -36,58 +46,58 @@ GIT
|
|||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
actioncable (5.0.0.rc1)
|
||||
actionpack (= 5.0.0.rc1)
|
||||
actioncable (5.1.0.alpha)
|
||||
actionpack (= 5.1.0.alpha)
|
||||
nio4r (~> 1.2)
|
||||
websocket-driver (~> 0.6.1)
|
||||
actionmailer (5.0.0.rc1)
|
||||
actionpack (= 5.0.0.rc1)
|
||||
actionview (= 5.0.0.rc1)
|
||||
activejob (= 5.0.0.rc1)
|
||||
actionmailer (5.1.0.alpha)
|
||||
actionpack (= 5.1.0.alpha)
|
||||
actionview (= 5.1.0.alpha)
|
||||
activejob (= 5.1.0.alpha)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
rails-dom-testing (~> 2.0)
|
||||
actionpack (5.0.0.rc1)
|
||||
actionview (= 5.0.0.rc1)
|
||||
activesupport (= 5.0.0.rc1)
|
||||
actionpack (5.1.0.alpha)
|
||||
actionview (= 5.1.0.alpha)
|
||||
activesupport (= 5.1.0.alpha)
|
||||
rack (~> 2.x)
|
||||
rack-test (~> 0.6.3)
|
||||
rails-dom-testing (~> 2.0)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||
actionview (5.0.0.rc1)
|
||||
activesupport (= 5.0.0.rc1)
|
||||
actionview (5.1.0.alpha)
|
||||
activesupport (= 5.1.0.alpha)
|
||||
builder (~> 3.1)
|
||||
erubis (~> 2.7.0)
|
||||
rails-dom-testing (~> 2.0)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||
activejob (5.0.0.rc1)
|
||||
activesupport (= 5.0.0.rc1)
|
||||
activejob (5.1.0.alpha)
|
||||
activesupport (= 5.1.0.alpha)
|
||||
globalid (>= 0.3.6)
|
||||
activemodel (5.0.0.rc1)
|
||||
activesupport (= 5.0.0.rc1)
|
||||
activerecord (5.0.0.rc1)
|
||||
activemodel (= 5.0.0.rc1)
|
||||
activesupport (= 5.0.0.rc1)
|
||||
activemodel (5.1.0.alpha)
|
||||
activesupport (= 5.1.0.alpha)
|
||||
activerecord (5.1.0.alpha)
|
||||
activemodel (= 5.1.0.alpha)
|
||||
activesupport (= 5.1.0.alpha)
|
||||
arel (~> 7.0)
|
||||
activesupport (5.0.0.rc1)
|
||||
activesupport (5.1.0.alpha)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (~> 0.7)
|
||||
minitest (~> 5.1)
|
||||
tzinfo (~> 1.1)
|
||||
rails (5.0.0.rc1)
|
||||
actioncable (= 5.0.0.rc1)
|
||||
actionmailer (= 5.0.0.rc1)
|
||||
actionpack (= 5.0.0.rc1)
|
||||
actionview (= 5.0.0.rc1)
|
||||
activejob (= 5.0.0.rc1)
|
||||
activemodel (= 5.0.0.rc1)
|
||||
activerecord (= 5.0.0.rc1)
|
||||
activesupport (= 5.0.0.rc1)
|
||||
rails (5.1.0.alpha)
|
||||
actioncable (= 5.1.0.alpha)
|
||||
actionmailer (= 5.1.0.alpha)
|
||||
actionpack (= 5.1.0.alpha)
|
||||
actionview (= 5.1.0.alpha)
|
||||
activejob (= 5.1.0.alpha)
|
||||
activemodel (= 5.1.0.alpha)
|
||||
activerecord (= 5.1.0.alpha)
|
||||
activesupport (= 5.1.0.alpha)
|
||||
bundler (>= 1.3.0, < 2.0)
|
||||
railties (= 5.0.0.rc1)
|
||||
railties (= 5.1.0.alpha)
|
||||
sprockets-rails (>= 2.0.0)
|
||||
railties (5.0.0.rc1)
|
||||
actionpack (= 5.0.0.rc1)
|
||||
activesupport (= 5.0.0.rc1)
|
||||
railties (5.1.0.alpha)
|
||||
actionpack (= 5.1.0.alpha)
|
||||
activesupport (= 5.1.0.alpha)
|
||||
method_source
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
|
@ -109,9 +119,6 @@ GEM
|
|||
bunny (2.2.2)
|
||||
amq-protocol (>= 2.0.1)
|
||||
byebug (8.2.5)
|
||||
coffee-rails (4.1.1)
|
||||
coffee-script (>= 2.2.0)
|
||||
railties (>= 4.0.0, < 5.1.x)
|
||||
coffee-script (2.4.1)
|
||||
coffee-script-source
|
||||
execjs
|
||||
|
@ -120,11 +127,6 @@ GEM
|
|||
connection_pool (2.2.0)
|
||||
dalli (2.7.6)
|
||||
dante (0.2.0)
|
||||
delayed_job (4.1.1)
|
||||
activesupport (>= 3.0, < 5.0)
|
||||
delayed_job_active_record (4.1.0)
|
||||
activerecord (>= 3.0, < 5)
|
||||
delayed_job (>= 3.0, < 5)
|
||||
em-hiredis (0.3.1)
|
||||
eventmachine (~> 1.0)
|
||||
hiredis (~> 0.6.0)
|
||||
|
@ -185,6 +187,12 @@ GEM
|
|||
pg (0.18.4-x86-mingw32)
|
||||
psych (2.0.17)
|
||||
puma (3.4.0)
|
||||
qu (0.2.0)
|
||||
multi_json
|
||||
qu-redis (0.2.0)
|
||||
qu (= 0.2.0)
|
||||
redis-namespace
|
||||
simple_uuid
|
||||
que (0.11.4)
|
||||
racc (1.4.14)
|
||||
rack (2.0.0.rc1)
|
||||
|
@ -231,6 +239,7 @@ GEM
|
|||
connection_pool (~> 2.2, >= 2.2.0)
|
||||
redis (~> 3.2, >= 3.2.1)
|
||||
sigdump (0.2.4)
|
||||
simple_uuid (0.4.0)
|
||||
sinatra (1.0)
|
||||
rack (>= 1.0)
|
||||
sneakers (2.3.5)
|
||||
|
@ -284,10 +293,10 @@ DEPENDENCIES
|
|||
bcrypt (~> 3.1.11)
|
||||
benchmark-ips
|
||||
byebug
|
||||
coffee-rails (~> 4.1.0)
|
||||
coffee-rails!
|
||||
dalli (>= 2.2.1)
|
||||
delayed_job
|
||||
delayed_job_active_record
|
||||
delayed_job!
|
||||
delayed_job_active_record!
|
||||
em-hiredis
|
||||
faye-websocket
|
||||
hiredis
|
||||
|
@ -301,7 +310,6 @@ DEPENDENCIES
|
|||
pg (>= 0.18.0)
|
||||
psych (~> 2.0)
|
||||
puma
|
||||
qu-rails!
|
||||
qu-redis
|
||||
que
|
||||
queue_classic!
|
||||
|
|
|
@ -1 +1 @@
|
|||
5.0.0.rc1
|
||||
5.1.0.alpha
|
||||
|
|
|
@ -1,88 +1,2 @@
|
|||
## Rails 5.0.0.rc1 (May 06, 2016) ##
|
||||
|
||||
* No changes.
|
||||
|
||||
|
||||
## Rails 5.0.0.beta4 (April 27, 2016) ##
|
||||
|
||||
* WebSocket protocol negotiation.
|
||||
|
||||
Introduces an Action Cable protocol version that moves independently
|
||||
of and, hopefully, more slowly than Action Cable itself. Client sockets
|
||||
negotiate a protocol with the Cable server using WebSockets' native
|
||||
subprotocol support:
|
||||
* https://tools.ietf.org/html/rfc6455#section-1.9
|
||||
* https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#Subprotocols
|
||||
|
||||
If they can't negotiate a compatible protocol (usually due to upgrading
|
||||
the Cable server with a browser still running old JavaScript) then the
|
||||
client knows to disconnect, cease retrying, and tell the app that it hit
|
||||
a protocol mismatch.
|
||||
|
||||
This allows us to evolve the Action Cable message format, handshaking,
|
||||
pings, acknowledgements, and more without breaking older clients'
|
||||
expectations of server behavior.
|
||||
|
||||
*Daniel Rhodes*
|
||||
|
||||
* Pubsub: automatic stream decoding.
|
||||
|
||||
stream_for @room, coder: ActiveSupport::JSON do |message|
|
||||
# `message` is a Ruby hash here instead of a JSON string
|
||||
|
||||
The `coder` must respond to `#decode`. Defaults to `coder: nil`
|
||||
which skips decoding entirely.
|
||||
|
||||
*Jeremy Daer*
|
||||
|
||||
* Add ActiveSupport::Notifications to ActionCable::Channel.
|
||||
|
||||
*Matthew Wear*
|
||||
|
||||
* Safely support autoloading and class unloading, by preventing concurrent
|
||||
loads, and disconnecting all cables during reload.
|
||||
|
||||
*Matthew Draper*
|
||||
|
||||
* Ensure ActionCable behaves correctly for non-string queue names.
|
||||
|
||||
*Jay Hayes*
|
||||
|
||||
## Rails 5.0.0.beta3 (February 24, 2016) ##
|
||||
|
||||
* Added `em_redis_connector` and `redis_connector` to
|
||||
`ActionCable::SubscriptionAdapter::EventedRedis` and added `redis_connector`
|
||||
to `ActionCable::SubscriptionAdapter::Redis`, so you can overwrite with your
|
||||
own initializers. This is used when you want to use different-than-standard
|
||||
Redis adapters, like for Makara distributed Redis.
|
||||
|
||||
*DHH*
|
||||
|
||||
## Rails 5.0.0.beta2 (February 01, 2016) ##
|
||||
|
||||
* Support PostgreSQL pubsub adapter.
|
||||
|
||||
*Jon Moss*
|
||||
|
||||
* Remove EventMachine dependency.
|
||||
|
||||
*Matthew Draper*
|
||||
|
||||
* Remove Celluloid dependency.
|
||||
|
||||
*Mike Perham*
|
||||
|
||||
* Create notion of an `ActionCable::SubscriptionAdapter`.
|
||||
Separate out Redis functionality into
|
||||
`ActionCable::SubscriptionAdapter::Redis`, and add a
|
||||
PostgreSQL adapter as well. Configuration file for
|
||||
ActionCable was changed from`config/redis/cable.yml` to
|
||||
`config/cable.yml`.
|
||||
|
||||
*Jon Moss*
|
||||
|
||||
## Rails 5.0.0.beta1 (December 18, 2015) ##
|
||||
|
||||
* Added to Rails!
|
||||
|
||||
*DHH*
|
||||
Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/actioncable/CHANGELOG.md) for previous changes.
|
||||
|
|
|
@ -6,9 +6,9 @@ module ActionCable
|
|||
|
||||
module VERSION
|
||||
MAJOR = 5
|
||||
MINOR = 0
|
||||
MINOR = 1
|
||||
TINY = 0
|
||||
PRE = "rc1"
|
||||
PRE = "alpha"
|
||||
|
||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||
end
|
||||
|
|
|
@ -1,141 +1,2 @@
|
|||
## Rails 5.0.0.rc1 (May 06, 2016) ##
|
||||
|
||||
* No changes.
|
||||
|
||||
|
||||
## Rails 5.0.0.beta4 (April 27, 2016) ##
|
||||
|
||||
* Disallow calling `#deliver_later` after making local modifications to
|
||||
the message which would be lost when the delivery job is enqueued.
|
||||
|
||||
Prevents a common, hard-to-find bug like:
|
||||
|
||||
message = Notifier.welcome(user, foo)
|
||||
message.message_id = my_generated_message_id
|
||||
message.deliver_later
|
||||
|
||||
The message_id is silently lost! *Only the mailer arguments are passed
|
||||
to the delivery job.*
|
||||
|
||||
This raises an exception now. Make modifications to the message within
|
||||
the mailer method instead, or use a custom Active Job to manage delivery
|
||||
instead of using #deliver_later.
|
||||
|
||||
*Jeremy Daer*
|
||||
|
||||
* Removes `-t` from default Sendmail arguments to match the underlying
|
||||
`Mail::Sendmail` setting.
|
||||
|
||||
*Clayton Liggitt*
|
||||
|
||||
|
||||
## Rails 5.0.0.beta3 (February 24, 2016) ##
|
||||
|
||||
* Add support for fragment caching in Action Mailer views.
|
||||
|
||||
*Stan Lo*
|
||||
|
||||
* Reset `ActionMailer::Base.deliveries` after every test in
|
||||
`ActionDispatch::IntegrationTest`.
|
||||
|
||||
*Yves Senn*
|
||||
|
||||
|
||||
## Rails 5.0.0.beta2 (February 01, 2016) ##
|
||||
|
||||
* No changes.
|
||||
|
||||
|
||||
## Rails 5.0.0.beta1 (December 18, 2015) ##
|
||||
|
||||
* `config.action_mailer.default_url_options[:protocol]` is now set to `https` if `config.force_ssl` is set to `true`.
|
||||
|
||||
*Andrew Kampjes*
|
||||
|
||||
* Add `config.action_mailer.deliver_later_queue_name` configuration to set the
|
||||
mailer queue name.
|
||||
|
||||
*Chris McGrath*
|
||||
|
||||
* `assert_emails` in block form, uses the given number as expected value.
|
||||
This makes the error message much easier to understand.
|
||||
|
||||
*Yuji Yaginuma*
|
||||
|
||||
* Add support for inline images in mailer previews by using an interceptor
|
||||
class to convert cid: urls in image src attributes to data urls.
|
||||
|
||||
*Andrew White*
|
||||
|
||||
* Mailer preview now uses `url_for` to fix links to emails for apps running on
|
||||
a subdirectory.
|
||||
|
||||
*Remo Mueller*
|
||||
|
||||
* Mailer previews no longer crash when the `mail` method wasn't called
|
||||
(`NullMail`).
|
||||
|
||||
Fixes #19849.
|
||||
|
||||
*Yves Senn*
|
||||
|
||||
* Make sure labels and values line up in mailer previews.
|
||||
|
||||
*Yves Senn*
|
||||
|
||||
* Add `assert_enqueued_emails` and `assert_no_enqueued_emails`.
|
||||
|
||||
Example:
|
||||
|
||||
def test_emails
|
||||
assert_enqueued_emails 2 do
|
||||
ContactMailer.welcome.deliver_later
|
||||
ContactMailer.welcome.deliver_later
|
||||
end
|
||||
end
|
||||
|
||||
def test_no_emails
|
||||
assert_no_enqueued_emails do
|
||||
# No emails enqueued here
|
||||
end
|
||||
end
|
||||
|
||||
*George Claghorn*
|
||||
|
||||
* Add `_mailer` suffix to mailers created via generator, following the same
|
||||
naming convention used in controllers and jobs.
|
||||
|
||||
*Carlos Souza*
|
||||
|
||||
* Remove deprecated `*_path` helpers in email views.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `deliver` and `deliver!` methods.
|
||||
|
||||
*claudiob*
|
||||
|
||||
* Template lookup now respects default locale and I18n fallbacks.
|
||||
|
||||
Given the following templates:
|
||||
|
||||
mailer/demo.html.erb
|
||||
mailer/demo.en.html.erb
|
||||
mailer/demo.pt.html.erb
|
||||
|
||||
Before this change, for a locale that doesn't have its associated file, the
|
||||
`mailer/demo.html.erb` would be rendered even if `en` was the default locale.
|
||||
|
||||
Now `mailer/demo.en.html.erb` has precedence over the file without locale.
|
||||
|
||||
Also, it is possible to give a fallback.
|
||||
|
||||
mailer/demo.pt.html.erb
|
||||
mailer/demo.pt-BR.html.erb
|
||||
|
||||
So if the locale is `pt-PT`, `mailer/demo.pt.html.erb` will be rendered given
|
||||
the right I18n fallback configuration.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/actionmailer/CHANGELOG.md) for previous changes.
|
||||
Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/actionmailer/CHANGELOG.md) for previous changes.
|
||||
|
|
|
@ -6,9 +6,9 @@ module ActionMailer
|
|||
|
||||
module VERSION
|
||||
MAJOR = 5
|
||||
MINOR = 0
|
||||
MINOR = 1
|
||||
TINY = 0
|
||||
PRE = "rc1"
|
||||
PRE = "alpha"
|
||||
|
||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||
end
|
||||
|
|
|
@ -1,823 +1,2 @@
|
|||
## Rails 5.0.0.rc1 (May 06, 2016) ##
|
||||
|
||||
* Add `ActionController#helpers` to get access to the view context at the controller
|
||||
level.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
|
||||
## Rails 5.0.0.beta4 (April 27, 2016) ##
|
||||
|
||||
* Routing: Refactor `:action` default handling to ensure that path
|
||||
parameters are not mutated during route generation.
|
||||
|
||||
*Andrew White*
|
||||
|
||||
* Add extension synonyms `yml` and `yaml` for MIME type `application/x-yaml`.
|
||||
|
||||
*bogdanvlviv*
|
||||
|
||||
* Adds support for including ActionController::Cookies in API controllers.
|
||||
Previously, including the module would raise when trying to define
|
||||
a `cookies` helper method. Skip calling #helper_method if it is not
|
||||
defined -- if we don't have helpers, we needn't define one.
|
||||
|
||||
Fixes #24304
|
||||
|
||||
*Ryan T. Hosford*
|
||||
|
||||
* ETags: Introduce `Response#strong_etag=` and `#weak_etag=` and analogous
|
||||
options for `fresh_when` and `stale?`. `Response#etag=` sets a weak ETag.
|
||||
|
||||
Strong ETags are desirable when you're serving byte-for-byte identical
|
||||
responses that support Range requests, like PDFs or videos (typically
|
||||
done by reproxying the response from a backend storage service).
|
||||
Also desirable when fronted by some CDNs that support strong ETags
|
||||
only, like Akamai.
|
||||
|
||||
*Jeremy Daer*
|
||||
|
||||
* ETags: No longer strips quotes (") from ETag values before comparing them.
|
||||
Quotes are significant, part of the ETag. A quoted ETag and an unquoted
|
||||
one are not the same entity.
|
||||
|
||||
*Jeremy Daer*
|
||||
|
||||
* ETags: Support `If-None-Match: *`. Rarely useful for GET requests; meant
|
||||
to provide some optimistic concurrency control for PUT requests.
|
||||
|
||||
*Jeremy Daer*
|
||||
|
||||
* `ActionDispatch::ParamsParser` is deprecated and was removed from the middleware
|
||||
stack. To configure the parameter parsers use `ActionDispatch::Request.parameter_parsers=`.
|
||||
|
||||
*tenderlove*
|
||||
|
||||
* When a `respond_to` collector with a block doesn't have a response, then
|
||||
a `:no_content` response should be rendered. This brings the default
|
||||
rendering behavior introduced by https://github.com/rails/rails/issues/19036
|
||||
to controller methods employing `respond_to`.
|
||||
|
||||
*Justin Coyne*
|
||||
|
||||
* Add `ActionController::Parameters#dig` on Ruby 2.3 and greater, which
|
||||
behaves the same as `Hash#dig`.
|
||||
|
||||
*Sean Griffin*
|
||||
|
||||
* Add request headers in the payload of the `start_processing.action_controller`
|
||||
and `process_action.action_controller` notifications.
|
||||
|
||||
*Gareth du Plooy*
|
||||
|
||||
* Add `action_dispatch_integration_test` load hook. The hook can be used to
|
||||
extend `ActionDispatch::IntegrationTest` once it has been loaded.
|
||||
|
||||
*Yuichiro Kaneko*
|
||||
|
||||
* Update default rendering policies when the controller action did
|
||||
not explicitly indicate a response.
|
||||
|
||||
For API controllers, the implicit render always renders "204 No Content"
|
||||
and does not account for any templates.
|
||||
|
||||
For other controllers, the following conditions are checked:
|
||||
|
||||
First, if a template exists for the controller action, it is rendered.
|
||||
This template lookup takes into account the action name, locales, format,
|
||||
variant, template handlers, etc. (see `render` for details).
|
||||
|
||||
Second, if other templates exist for the controller action but is not in
|
||||
the right format (or variant, etc.), an `ActionController::UnknownFormat`
|
||||
is raised. The list of available templates is assumed to be a complete
|
||||
enumeration of all the possible formats (or variants, etc.); that is,
|
||||
having only HTML and JSON templates indicate that the controller action is
|
||||
not meant to handle XML requests.
|
||||
|
||||
Third, if the current request is an "interactive" browser request (the user
|
||||
navigated here by entering the URL in the address bar, submitting a form,
|
||||
clicking on a link, etc. as opposed to an XHR or non-browser API request),
|
||||
`ActionView::UnknownFormat` is raised to display a helpful error
|
||||
message.
|
||||
|
||||
Finally, it falls back to the same "204 No Content" behavior as API controllers.
|
||||
|
||||
*Godfrey Chan*, *Jon Moss*, *Kasper Timm Hansen*, *Mike Clark*, *Matthew Draper*
|
||||
|
||||
## Rails 5.0.0.beta3 (February 24, 2016) ##
|
||||
|
||||
* Add "application/gzip" as a default mime type.
|
||||
|
||||
*Mehmet Emin İNAÇ*
|
||||
|
||||
* Add request encoding and response parsing to integration tests.
|
||||
|
||||
What previously was:
|
||||
|
||||
```ruby
|
||||
require 'test_helper'
|
||||
|
||||
class ApiTest < ActionDispatch::IntegrationTest
|
||||
test 'creates articles' do
|
||||
assert_difference -> { Article.count } do
|
||||
post articles_path(format: :json),
|
||||
params: { article: { title: 'Ahoy!' } }.to_json,
|
||||
headers: { 'Content-Type' => 'application/json' }
|
||||
end
|
||||
|
||||
assert_equal({ 'id' => Article.last.id, 'title' => 'Ahoy!' }, JSON.parse(response.body))
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
Can now be written as:
|
||||
|
||||
```ruby
|
||||
require 'test_helper'
|
||||
|
||||
class ApiTest < ActionDispatch::IntegrationTest
|
||||
test 'creates articles' do
|
||||
assert_difference -> { Article.count } do
|
||||
post articles_path, params: { article: { title: 'Ahoy!' } }, as: :json
|
||||
end
|
||||
|
||||
assert_equal({ 'id' => Article.last.id, 'title' => 'Ahoy!' }, response.parsed_body)
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
Passing `as: :json` to integration test request helpers will set the format,
|
||||
content type and encode the parameters as JSON.
|
||||
|
||||
Then on the response side, `parsed_body` will parse the body according to the
|
||||
content type the response has.
|
||||
|
||||
Currently JSON is the only supported MIME type. Add your own with
|
||||
`ActionDispatch::IntegrationTest.register_encoder`.
|
||||
|
||||
*Kasper Timm Hansen*
|
||||
|
||||
* Add "image/svg+xml" as a default mime type.
|
||||
|
||||
*DHH*
|
||||
|
||||
## Rails 5.0.0.beta2 (February 01, 2016) ##
|
||||
|
||||
* Add `-g` and `-c` options to `bin/rails routes`. These options return the url `name`, `verb` and
|
||||
`path` field that match the pattern or match a specific controller.
|
||||
|
||||
Deprecate `CONTROLLER` env variable in `bin/rails routes`.
|
||||
|
||||
See #18902.
|
||||
|
||||
*Anton Davydov*, *Vipul A M*
|
||||
|
||||
* Response etags to always be weak: Prefixes 'W/' to value returned by
|
||||
`ActionDispatch::Http::Cache::Response#etag=`, such that etags set in
|
||||
`fresh_when` and `stale?` are weak.
|
||||
|
||||
Fixes #17556.
|
||||
|
||||
*Abhishek Yadav*
|
||||
|
||||
* Provide the name of HTTP Status code in assertions.
|
||||
|
||||
*Sean Collins*
|
||||
|
||||
* More explicit error message when running `rake routes`. `CONTROLLER` argument
|
||||
can now be supplied in different ways:
|
||||
`Rails::WelcomeController`, `Rails::Welcome`, `rails/welcome`.
|
||||
|
||||
Fixes #22918.
|
||||
|
||||
*Edouard Chin*
|
||||
|
||||
* Allow `ActionController::Parameters` instances as an argument to URL
|
||||
helper methods. An `ArgumentError` will be raised if the passed parameters
|
||||
are not secure.
|
||||
|
||||
Fixes #22832.
|
||||
|
||||
*Prathamesh Sonpatki*
|
||||
|
||||
* Add option for per-form CSRF tokens.
|
||||
|
||||
*Greg Ose*, *Ben Toews*
|
||||
|
||||
* Fix `ActionController::Parameters#convert_parameters_to_hashes` to return filtered
|
||||
or unfiltered values based on from where it is called, `to_h` or `to_unsafe_h`
|
||||
respectively.
|
||||
|
||||
Fixes #22841.
|
||||
|
||||
*Prathamesh Sonpatki*
|
||||
|
||||
* Add `ActionController::Parameters#include?`
|
||||
|
||||
*Justin Coyne*
|
||||
|
||||
## Rails 5.0.0.beta1 (December 18, 2015) ##
|
||||
|
||||
* Deprecate `redirect_to :back` in favor of `redirect_back`, which accepts a
|
||||
required `fallback_location` argument, thus eliminating the possibility of a
|
||||
`RedirectBackError`.
|
||||
|
||||
*Derek Prior*
|
||||
|
||||
* Add `redirect_back` method to `ActionController::Redirecting` to provide a
|
||||
way to safely redirect to the `HTTP_REFERER` if it is present, falling back
|
||||
to a provided redirect otherwise.
|
||||
|
||||
*Derek Prior*
|
||||
|
||||
* `ActionController::TestCase` will be moved to its own gem in Rails 5.1.
|
||||
|
||||
With the speed improvements made to `ActionDispatch::IntegrationTest` we no
|
||||
longer need to keep two separate code bases for testing controllers. In
|
||||
Rails 5.1 `ActionController::TestCase` will be deprecated and moved into a
|
||||
gem outside of Rails source.
|
||||
|
||||
This is a documentation deprecation so that going forward new tests will use
|
||||
`ActionDispatch::IntegrationTest` instead of `ActionController::TestCase`.
|
||||
|
||||
*Eileen M. Uchitelle*
|
||||
|
||||
* Add a `response_format` option to `ActionDispatch::DebugExceptions`
|
||||
to configure the format of the response when errors occur in
|
||||
development mode.
|
||||
|
||||
If `response_format` is `:default` the debug info will be rendered
|
||||
in an HTML page. In the other hand, if the provided value is `:api`
|
||||
the debug info will be rendered in the original response format.
|
||||
|
||||
*Jorge Bejar*
|
||||
|
||||
* Change the `protect_from_forgery` prepend default to `false`.
|
||||
|
||||
Per this comment
|
||||
https://github.com/rails/rails/pull/18334#issuecomment-69234050 we want
|
||||
`protect_from_forgery` to default to `prepend: false`.
|
||||
|
||||
`protect_from_forgery` will now be inserted into the callback chain at the
|
||||
point it is called in your application. This is useful for cases where you
|
||||
want to `protect_from_forgery` after you perform required authentication
|
||||
callbacks or other callbacks that are required to run after forgery protection.
|
||||
|
||||
If you want `protect_from_forgery` callbacks to always run first, regardless of
|
||||
position they are called in your application then you can add `prepend: true`
|
||||
to your `protect_from_forgery` call.
|
||||
|
||||
Example:
|
||||
|
||||
```ruby
|
||||
protect_from_forgery prepend: true
|
||||
```
|
||||
|
||||
*Eileen M. Uchitelle*
|
||||
|
||||
* In url_for, never append a question mark to the URL when the query string
|
||||
is empty anyway. (It used to do that when called like `url_for(controller:
|
||||
'x', action: 'y', q: {})`.)
|
||||
|
||||
*Paul Grayson*
|
||||
|
||||
* Catch invalid UTF-8 querystring values and respond with BadRequest
|
||||
|
||||
Check querystring params for invalid UTF-8 characters, and raise an
|
||||
ActionController::BadRequest error if present. Previously these strings
|
||||
would typically trigger errors further down the stack.
|
||||
|
||||
*Grey Baker*
|
||||
|
||||
* Parse RSS/ATOM responses as XML, not HTML.
|
||||
|
||||
*Alexander Kaupanin*
|
||||
|
||||
* Show helpful message in `BadRequest` exceptions due to invalid path
|
||||
parameter encodings.
|
||||
|
||||
Fixes #21923.
|
||||
|
||||
*Agis Anastasopoulos*
|
||||
|
||||
* Add the ability of returning arbitrary headers to `ActionDispatch::Static`.
|
||||
|
||||
Now ActionDispatch::Static can accept HTTP headers so that developers
|
||||
will have control of returning arbitrary headers like
|
||||
'Access-Control-Allow-Origin' when a response is delivered. They can be
|
||||
configured with `#config`:
|
||||
|
||||
Example:
|
||||
|
||||
config.public_file_server.headers = {
|
||||
"Cache-Control" => "public, max-age=60",
|
||||
"Access-Control-Allow-Origin" => "http://rubyonrails.org"
|
||||
}
|
||||
|
||||
*Yuki Nishijima*
|
||||
|
||||
* Allow multiple `root` routes in same scope level. Example:
|
||||
|
||||
Example:
|
||||
|
||||
root 'blog#show', constraints: ->(req) { Hostname.blog_site?(req.host) }
|
||||
root 'landing#show'
|
||||
|
||||
*Rafael Sales*
|
||||
|
||||
* Fix regression in mounted engine named routes generation for app deployed to
|
||||
a subdirectory. `relative_url_root` was prepended to the path twice (e.g.
|
||||
"/subdir/subdir/engine_path" instead of "/subdir/engine_path")
|
||||
|
||||
Fixes #20920. Fixes #21459.
|
||||
|
||||
*Matthew Erhard*
|
||||
|
||||
* `ActionDispatch::Response#new` no longer applies default headers. If you want
|
||||
default headers applied to the response object, then call
|
||||
`ActionDispatch::Response.create`. This change only impacts people who are
|
||||
directly constructing an `ActionDispatch::Response` object.
|
||||
|
||||
* Accessing mime types via constants like `Mime::HTML` is deprecated. Please
|
||||
change code like this:
|
||||
|
||||
Mime::HTML
|
||||
|
||||
To this:
|
||||
|
||||
Mime[:html]
|
||||
|
||||
This change is so that Rails will not manage a list of constants, and fixes
|
||||
an issue where if a type isn't registered you could possibly get the wrong
|
||||
object.
|
||||
|
||||
`Mime[:html]` is available in older versions of Rails, too, so you can
|
||||
safely change libraries and plugins and maintain compatibility with
|
||||
multiple versions of Rails.
|
||||
|
||||
* `url_for` does not modify its arguments when generating polymorphic URLs.
|
||||
|
||||
*Bernerd Schaefer*
|
||||
|
||||
* Make it easier to opt in to `config.force_ssl` and `config.ssl_options` by
|
||||
making them less dangerous to try and easier to disable.
|
||||
|
||||
SSL redirect:
|
||||
* Move `:host` and `:port` options within `redirect: { … }`. Deprecate.
|
||||
* Introduce `:status` and `:body` to customize the redirect response.
|
||||
The 301 permanent default makes it difficult to test the redirect and
|
||||
back out of it since browsers remember the 301. Test with a 302 or 307
|
||||
instead, then switch to 301 once you're confident that all is well.
|
||||
|
||||
HTTP Strict Transport Security (HSTS):
|
||||
* Shorter max-age. Shorten the default max-age from 1 year to 180 days,
|
||||
the low end for https://www.ssllabs.com/ssltest/ grading and greater
|
||||
than the 18-week minimum to qualify for browser preload lists.
|
||||
* Disabling HSTS. Setting `hsts: false` now sets `hsts { expires: 0 }`
|
||||
instead of omitting the header. Omitting does nothing to disable HSTS
|
||||
since browsers hang on to your previous settings until they expire.
|
||||
Sending `{ hsts: { expires: 0 }}` flushes out old browser settings and
|
||||
actually disables HSTS:
|
||||
http://tools.ietf.org/html/rfc6797#section-6.1.1
|
||||
* HSTS Preload. Introduce `preload: true` to set the `preload` flag,
|
||||
indicating that your site may be included in browser preload lists,
|
||||
including Chrome, Firefox, Safari, IE11, and Edge. Submit your site:
|
||||
https://hstspreload.appspot.com
|
||||
|
||||
*Jeremy Daer*
|
||||
|
||||
* Update `ActionController::TestSession#fetch` to behave more like
|
||||
`ActionDispatch::Request::Session#fetch` when using non-string keys.
|
||||
|
||||
*Jeremy Friesen*
|
||||
|
||||
* Using strings or symbols for middleware class names is deprecated. Convert
|
||||
things like this:
|
||||
|
||||
middleware.use "Foo::Bar"
|
||||
|
||||
to this:
|
||||
|
||||
middleware.use Foo::Bar
|
||||
|
||||
* `ActionController::TestSession` now accepts a default value as well as
|
||||
a block for generating a default value based off the key provided.
|
||||
|
||||
This fixes calls to `session#fetch` in `ApplicationController` instances that
|
||||
take more two arguments or a block from raising `ArgumentError: wrong
|
||||
number of arguments (2 for 1)` when performing controller tests.
|
||||
|
||||
*Matthew Gerrior*
|
||||
|
||||
* Fix `ActionController::Parameters#fetch` overwriting `KeyError` returned by
|
||||
default block.
|
||||
|
||||
*Jonas Schuber Erlandsson*, *Roque Pinel*
|
||||
|
||||
* `ActionController::Parameters` no longer inherits from
|
||||
`HashWithIndifferentAccess`
|
||||
|
||||
Inheriting from `HashWithIndifferentAccess` allowed users to call any
|
||||
enumerable methods on `Parameters` object, resulting in a risk of losing the
|
||||
`permitted?` status or even getting back a pure `Hash` object instead of
|
||||
a `Parameters` object with proper sanitization.
|
||||
|
||||
By not inheriting from `HashWithIndifferentAccess`, we are able to make
|
||||
sure that all methods that are defined in `Parameters` object will return
|
||||
a proper `Parameters` object with a correct `permitted?` flag.
|
||||
|
||||
*Prem Sichanugrist*
|
||||
|
||||
* Replaced `ActiveSupport::Concurrency::Latch` with `Concurrent::CountDownLatch`
|
||||
from the concurrent-ruby gem.
|
||||
|
||||
*Jerry D'Antonio*
|
||||
|
||||
* Add ability to filter parameters based on parent keys.
|
||||
|
||||
# matches {credit_card: {code: "xxxx"}}
|
||||
# doesn't match {file: { code: "xxxx"}}
|
||||
config.filter_parameters += [ "credit_card.code" ]
|
||||
|
||||
See #13897.
|
||||
|
||||
*Guillaume Malette*
|
||||
|
||||
* Deprecate passing first parameter as `Hash` and default status code for `head` method.
|
||||
|
||||
*Mehmet Emin İNAÇ*
|
||||
|
||||
* Adds`Rack::Utils::ParameterTypeError` and `Rack::Utils::InvalidParameterError`
|
||||
to the rescue_responses hash in `ExceptionWrapper` (Rack recommends
|
||||
integrators serve 400s for both of these).
|
||||
|
||||
*Grey Baker*
|
||||
|
||||
* Add support for API only apps.
|
||||
`ActionController::API` is added as a replacement of
|
||||
`ActionController::Base` for this kind of applications.
|
||||
|
||||
*Santiago Pastorino*, *Jorge Bejar*
|
||||
|
||||
* Remove `assigns` and `assert_template`. Both methods have been extracted
|
||||
into a gem at https://github.com/rails/rails-controller-testing.
|
||||
|
||||
See #18950.
|
||||
|
||||
*Alan Guo Xiang Tan*
|
||||
|
||||
* `FileHandler` and `Static` middleware initializers accept `index` argument
|
||||
to configure the directory index file name. Defaults to `index` (as in
|
||||
`index.html`).
|
||||
|
||||
See #20017.
|
||||
|
||||
*Eliot Sykes*
|
||||
|
||||
* Deprecate `:nothing` option for `render` method.
|
||||
|
||||
*Mehmet Emin İNAÇ*
|
||||
|
||||
* Fix `rake routes` not showing the right format when
|
||||
nesting multiple routes.
|
||||
|
||||
See #18373.
|
||||
|
||||
*Ravil Bayramgalin*
|
||||
|
||||
* Add ability to override default form builder for a controller.
|
||||
|
||||
class AdminController < ApplicationController
|
||||
default_form_builder AdminFormBuilder
|
||||
end
|
||||
|
||||
*Kevin McPhillips*
|
||||
|
||||
* For actions with no corresponding templates, render `head :no_content`
|
||||
instead of raising an error. This allows for slimmer API controller
|
||||
methods that simply work, without needing further instructions.
|
||||
|
||||
See #19036.
|
||||
|
||||
*Stephen Bussey*
|
||||
|
||||
* Provide friendlier access to request variants.
|
||||
|
||||
request.variant = :phone
|
||||
request.variant.phone? # true
|
||||
request.variant.tablet? # false
|
||||
|
||||
request.variant = [:phone, :tablet]
|
||||
request.variant.phone? # true
|
||||
request.variant.desktop? # false
|
||||
request.variant.any?(:phone, :desktop) # true
|
||||
request.variant.any?(:desktop, :watch) # false
|
||||
|
||||
*George Claghorn*
|
||||
|
||||
* Fix regression where a gzip file response would have a Content-type,
|
||||
even when it was a 304 status code.
|
||||
|
||||
See #19271.
|
||||
|
||||
*Kohei Suzuki*
|
||||
|
||||
* Fix handling of empty `X_FORWARDED_HOST` header in `raw_host_with_port`.
|
||||
|
||||
Previously, an empty `X_FORWARDED_HOST` header would cause
|
||||
`Actiondispatch::Http:URL.raw_host_with_port` to return `nil`, causing
|
||||
`Actiondispatch::Http:URL.host` to raise a `NoMethodError`.
|
||||
|
||||
*Adam Forsyth*
|
||||
|
||||
* Allow `Bearer` as token-keyword in `Authorization-Header`.
|
||||
|
||||
Additionally to `Token`, the keyword `Bearer` is acceptable as a keyword
|
||||
for the auth-token. The `Bearer` keyword is described in the original
|
||||
OAuth RFC and used in libraries like Angular-JWT.
|
||||
|
||||
See #19094.
|
||||
|
||||
*Peter Schröder*
|
||||
|
||||
* Drop request class from `RouteSet` constructor.
|
||||
|
||||
If you would like to use a custom request class, please subclass and implement
|
||||
the `request_class` method.
|
||||
|
||||
*tenderlove@ruby-lang.org*
|
||||
|
||||
* Fallback to `ENV['RAILS_RELATIVE_URL_ROOT']` in `url_for`.
|
||||
|
||||
Fixed an issue where the `RAILS_RELATIVE_URL_ROOT` environment variable is not
|
||||
prepended to the path when `url_for` is called. If `SCRIPT_NAME` (used by Rack)
|
||||
is set, it takes precedence.
|
||||
|
||||
Fixes #5122.
|
||||
|
||||
*Yasyf Mohamedali*
|
||||
|
||||
* Partitioning of routes is now done when the routes are being drawn. This
|
||||
helps to decrease the time spent filtering the routes during the first request.
|
||||
|
||||
*Guo Xiang Tan*
|
||||
|
||||
* Fix regression in functional tests. Responses should have default headers
|
||||
assigned.
|
||||
|
||||
See #18423.
|
||||
|
||||
*Jeremy Kemper*, *Yves Senn*
|
||||
|
||||
* Deprecate `AbstractController#skip_action_callback` in favor of individual skip_callback methods
|
||||
(which can be made to raise an error if no callback was removed).
|
||||
|
||||
*Iain Beeston*
|
||||
|
||||
* Alias the `ActionDispatch::Request#uuid` method to `ActionDispatch::Request#request_id`.
|
||||
Due to implementation, `config.log_tags = [:request_id]` also works in substitute
|
||||
for `config.log_tags = [:uuid]`.
|
||||
|
||||
*David Ilizarov*
|
||||
|
||||
* Change filter on /rails/info/routes to use an actual path regexp from rails
|
||||
and not approximate javascript version. Oniguruma supports much more
|
||||
extensive list of features than javascript regexp engine.
|
||||
|
||||
Fixes #18402.
|
||||
|
||||
*Ravil Bayramgalin*
|
||||
|
||||
* Non-string authenticity tokens do not raise NoMethodError when decoding
|
||||
the masked token.
|
||||
|
||||
*Ville Lautanala*
|
||||
|
||||
* Add `http_cache_forever` to Action Controller, so we can cache a response
|
||||
that never gets expired.
|
||||
|
||||
*arthurnn*
|
||||
|
||||
* `ActionController#translate` supports symbols as shortcuts.
|
||||
When a shortcut is given it also performs the lookup without the action
|
||||
name.
|
||||
|
||||
*Max Melentiev*
|
||||
|
||||
* Expand `ActionController::ConditionalGet#fresh_when` and `stale?` to also
|
||||
accept a collection of records as the first argument, so that the
|
||||
following code can be written in a shorter form.
|
||||
|
||||
# Before
|
||||
def index
|
||||
@articles = Article.all
|
||||
fresh_when(etag: @articles, last_modified: @articles.maximum(:updated_at))
|
||||
end
|
||||
|
||||
# After
|
||||
def index
|
||||
@articles = Article.all
|
||||
fresh_when(@articles)
|
||||
end
|
||||
|
||||
*claudiob*
|
||||
|
||||
* Explicitly ignored wildcard verbs when searching for HEAD routes before fallback
|
||||
|
||||
Fixes an issue where a mounted rack app at root would intercept the HEAD
|
||||
request causing an incorrect behavior during the fall back to GET requests.
|
||||
|
||||
Example:
|
||||
|
||||
draw do
|
||||
get '/home' => 'test#index'
|
||||
mount rack_app, at: '/'
|
||||
end
|
||||
head '/home'
|
||||
assert_response :success
|
||||
|
||||
In this case, a HEAD request runs through the routes the first time and fails
|
||||
to match anything. Then, it runs through the list with the fallback and matches
|
||||
`get '/home'`. The original behavior would match the rack app in the first pass.
|
||||
|
||||
*Terence Sun*
|
||||
|
||||
* Migrating xhr methods to keyword arguments syntax
|
||||
in `ActionController::TestCase` and `ActionDispatch::Integration`
|
||||
|
||||
Old syntax:
|
||||
|
||||
xhr :get, :create, params: { id: 1 }
|
||||
|
||||
New syntax example:
|
||||
|
||||
get :create, params: { id: 1 }, xhr: true
|
||||
|
||||
*Kir Shatrov*
|
||||
|
||||
* Migrating to keyword arguments syntax in `ActionController::TestCase` and
|
||||
`ActionDispatch::Integration` HTTP request methods.
|
||||
|
||||
Example:
|
||||
|
||||
post :create, params: { y: x }, session: { a: 'b' }
|
||||
get :view, params: { id: 1 }
|
||||
get :view, params: { id: 1 }, format: :json
|
||||
|
||||
*Kir Shatrov*
|
||||
|
||||
* Preserve default url options when generating URLs.
|
||||
|
||||
Fixes an issue that would cause `default_url_options` to be lost when
|
||||
generating URLs with fewer positional arguments than parameters in the
|
||||
route definition.
|
||||
|
||||
*Tekin Suleyman*
|
||||
|
||||
* Deprecate `*_via_redirect` integration test methods.
|
||||
|
||||
Use `follow_redirect!` manually after the request call for the same behavior.
|
||||
|
||||
*Aditya Kapoor*
|
||||
|
||||
* Add `ActionController::Renderer` to render arbitrary templates
|
||||
outside controller actions.
|
||||
|
||||
Its functionality is accessible through class methods `render` and
|
||||
`renderer` of `ActionController::Base`.
|
||||
|
||||
*Ravil Bayramgalin*
|
||||
|
||||
* Support `:assigns` option when rendering with controllers/mailers.
|
||||
|
||||
*Ravil Bayramgalin*
|
||||
|
||||
* Default headers, removed in controller actions, are no longer reapplied on
|
||||
the test response.
|
||||
|
||||
*Jonas Baumann*
|
||||
|
||||
* Deprecate all `*_filter` callbacks in favor of `*_action` callbacks.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Allow you to pass `prepend: false` to `protect_from_forgery` to have the
|
||||
verification callback appended instead of prepended to the chain.
|
||||
This allows you to let the verification step depend on prior callbacks.
|
||||
|
||||
Example:
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
before_action :authenticate
|
||||
protect_from_forgery prepend: false, unless: -> { @authenticated_by.oauth? }
|
||||
|
||||
private
|
||||
def authenticate
|
||||
if oauth_request?
|
||||
# authenticate with oauth
|
||||
@authenticated_by = 'oauth'.inquiry
|
||||
else
|
||||
# authenticate with cookies
|
||||
@authenticated_by = 'cookie'.inquiry
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
*Josef Šimánek*
|
||||
|
||||
* Remove `ActionController::HideActions`.
|
||||
|
||||
*Ravil Bayramgalin*
|
||||
|
||||
* Remove `respond_to`/`respond_with` placeholder methods, this functionality
|
||||
has been extracted to the `responders` gem.
|
||||
|
||||
*Carlos Antonio da Silva*
|
||||
|
||||
* Remove deprecated assertion files.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated usage of string keys in URL helpers.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `only_path` option on `*_path` helpers.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `NamedRouteCollection#helpers`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated support to define routes with `:to` option that doesn't contain `#`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `ActionDispatch::Response#to_ary`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `ActionDispatch::Request#deep_munge`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `ActionDispatch::Http::Parameters#symbolized_path_parameters`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated option `use_route` in controller tests.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Ensure `append_info_to_payload` is called even if an exception is raised.
|
||||
|
||||
Fixes an issue where when an exception is raised in the request the additional
|
||||
payload data is not available.
|
||||
|
||||
See #14903.
|
||||
|
||||
*Dieter Komendera*, *Margus Pärt*
|
||||
|
||||
* Correctly rely on the response's status code to handle calls to `head`.
|
||||
|
||||
*Robin Dupret*
|
||||
|
||||
* Using `head` method returns empty response_body instead
|
||||
of returning a single space " ".
|
||||
|
||||
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.
|
||||
|
||||
Fixes #18253.
|
||||
|
||||
*Prathamesh Sonpatki*
|
||||
|
||||
* Fix how polymorphic routes works with objects that implement `to_model`.
|
||||
|
||||
*Travis Grathwell*
|
||||
|
||||
* Stop converting empty arrays in `params` to `nil`.
|
||||
|
||||
This behavior was introduced in response to CVE-2012-2660, CVE-2012-2694
|
||||
and CVE-2013-0155
|
||||
|
||||
ActiveRecord now issues a safe query when passing an empty array into
|
||||
a where clause, so there is no longer a need to defend against this type
|
||||
of input (any nils are still stripped from the array).
|
||||
|
||||
*Chris Sinjakli*
|
||||
|
||||
* Fixed usage of optional scopes in url helpers.
|
||||
|
||||
*Alex Robbin*
|
||||
|
||||
* Fixed handling of positional url helper arguments when `format: false`.
|
||||
|
||||
Fixes #17819.
|
||||
|
||||
*Andrew White*, *Tatiana Soukiassian*
|
||||
|
||||
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/actionpack/CHANGELOG.md) for previous changes.
|
||||
Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/actionpack/CHANGELOG.md) for previous changes.
|
||||
|
|
|
@ -6,9 +6,9 @@ module ActionPack
|
|||
|
||||
module VERSION
|
||||
MAJOR = 5
|
||||
MINOR = 0
|
||||
MINOR = 1
|
||||
TINY = 0
|
||||
PRE = "rc1"
|
||||
PRE = "alpha"
|
||||
|
||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||
end
|
||||
|
|
|
@ -1,343 +1,2 @@
|
|||
## Rails 5.0.0.rc1 (May 06, 2016) ##
|
||||
|
||||
* No changes.
|
||||
|
||||
|
||||
## Rails 5.0.0.beta4 (April 27, 2016) ##
|
||||
|
||||
* `date_select` helper `:with_css_classes` option now accepts a hash of strings
|
||||
for `:year`, `:month`, `:day`, `:hour`, `:minute`, `:second` that will extend
|
||||
the select type with the given css class value.
|
||||
|
||||
```erb
|
||||
<%= f.date_select :birthday, with_css_classes: { month: "my-month", year: "my-year" } %>
|
||||
```
|
||||
|
||||
```html
|
||||
<select id="user_birthday_3i" name="user[birthday(3i)]">…</select>
|
||||
<select id="user_birthday_2i" name="user[birthday(2i)]" class="my-month">…</select>
|
||||
<select id="user_birthday_1i" name="user[birthday(1i)]" class="my-year">…</select>
|
||||
```
|
||||
|
||||
*Matthias Neumayr*
|
||||
|
||||
* Add `to_sentence` helper that is a HTML-safe aware version of `Array#to_sentence`.
|
||||
|
||||
*Neil Matatall*
|
||||
|
||||
* Deprecate `datetime_field` and `datetime_field_tag` helpers.
|
||||
Datetime input type was removed from HTML specification.
|
||||
One can use `datetime_local_field` and `datetime_local_field_tag` instead.
|
||||
|
||||
*Wojciech Wnętrzak*
|
||||
|
||||
* Added log "Rendering ...", when starting to render a template to log that
|
||||
we have started rendering something. This helps to easily identify the origin
|
||||
of queries in the log whether they came from controller or views.
|
||||
|
||||
*Vipul A M and Prem Sichanugrist*
|
||||
|
||||
## Rails 5.0.0.beta3 (February 24, 2016) ##
|
||||
|
||||
* Collection rendering can cache and fetch multiple partials at once.
|
||||
|
||||
Collections rendered as:
|
||||
|
||||
```ruby
|
||||
<%= render partial: 'notifications/notification', collection: @notifications, as: :notification, cached: true %>
|
||||
```
|
||||
|
||||
will read several partials from cache at once. The templates in the collection
|
||||
that haven't been cached already will automatically be written to cache. Works
|
||||
great alongside individual template fragment caching. For instance if the
|
||||
template the collection renders is cached like:
|
||||
|
||||
```ruby
|
||||
# notifications/_notification.html.erb
|
||||
<% cache notification do %>
|
||||
<%# ... %>
|
||||
<% end %>
|
||||
```
|
||||
|
||||
Then any collection renders shares that cache when attempting to read multiple
|
||||
ones at once.
|
||||
|
||||
*Kasper Timm Hansen*
|
||||
|
||||
* Add support for nested hashes/arrays to `:params` option of `button_to` helper.
|
||||
|
||||
*James Coleman*
|
||||
|
||||
## Rails 5.0.0.beta2 (February 01, 2016) ##
|
||||
|
||||
* Fix stripping the digest from the automatically generated img tag alt
|
||||
attribute when assets are handled by Sprockets >=3.0.
|
||||
|
||||
*Bart de Water*
|
||||
|
||||
* Create a new `ActiveSupport::SafeBuffer` instance when `content_for` is flushed.
|
||||
|
||||
Fixes #19890.
|
||||
|
||||
*Yoong Kang Lim*
|
||||
|
||||
* Fix `collection_radio_buttons` hidden_field name and make it appear
|
||||
before the actual input radio tags to make the real value override
|
||||
the hidden when passed.
|
||||
|
||||
Fixes #22773.
|
||||
|
||||
*Santiago Pastorino*
|
||||
|
||||
* `ActionView::TestCase::Controller#params` returns an instance of
|
||||
`ActionController::Parameters`.
|
||||
|
||||
*Justin Coyne*
|
||||
|
||||
* Fix regression in `submit_tag` when a symbol is used as label argument.
|
||||
|
||||
*Yuuji Yaginuma*
|
||||
|
||||
|
||||
## Rails 5.0.0.beta1 (December 18, 2015) ##
|
||||
|
||||
* `I18n.translate` helper will wrap the missing translation keys
|
||||
in a <span> tag only if `debug_missing_translation` configuration
|
||||
be true. Default value is `true`. For example in `application.rb`:
|
||||
|
||||
# in order to turn off missing key wrapping
|
||||
config.action_view.debug_missing_translation = false
|
||||
|
||||
*Sameer Rahmani*
|
||||
|
||||
* Respect value of `:object` if `:object` is false when rendering.
|
||||
|
||||
Fixes #22260.
|
||||
|
||||
*Yuichiro Kaneko*
|
||||
|
||||
* Generate `week_field` input values using a 1-based index and not a 0-based index
|
||||
as per the W3 spec: http://www.w3.org/TR/html-markup/datatypes.html#form.data.week
|
||||
|
||||
*Christoph Geschwind*
|
||||
|
||||
* Allow `host` option in `javascript_include_tag` and `stylesheet_link_tag` helpers
|
||||
|
||||
*Grzegorz Witek*
|
||||
|
||||
* Restrict `url_for :back` to valid, non-JavaScript URLs. GH#14444
|
||||
|
||||
*Damien Burke*
|
||||
|
||||
* Allow `date_select` helper selected option to accept hash like the default options.
|
||||
|
||||
*Lecky Lao*
|
||||
|
||||
* Collection input propagates input's `id` to the label's `for` attribute when
|
||||
using html options as the last element of collection.
|
||||
|
||||
*Vasiliy Ermolovich*
|
||||
|
||||
* Add a `hidden_field` on the `collection_radio_buttons` to avoid raising an error
|
||||
when the only input on the form is the `collection_radio_buttons`.
|
||||
|
||||
*Mauro George*
|
||||
|
||||
* `url_for` does not modify its arguments when generating polymorphic URLs.
|
||||
|
||||
*Bernerd Schaefer*
|
||||
|
||||
* `number_to_currency` and `number_with_delimiter` now accept a custom `delimiter_pattern` option
|
||||
to handle placement of delimiter, to support currency formats like INR.
|
||||
|
||||
Example:
|
||||
|
||||
number_to_currency(1230000, delimiter_pattern: /(\d+?)(?=(\d\d)+(\d)(?!\d))/, unit: '₹', format: "%u %n")
|
||||
# => '₹ 12,30,000.00'
|
||||
|
||||
*Vipul A M*
|
||||
|
||||
* Make `disable_with` the default behavior for submit tags. Disables the
|
||||
button on submit to prevent double submits.
|
||||
|
||||
*Justin Schiff*
|
||||
|
||||
* Add a break_sequence option to word_wrap so you can specify a custom break.
|
||||
|
||||
*Mauricio Gomez*
|
||||
|
||||
* Add wildcard matching to explicit dependencies.
|
||||
|
||||
Turns:
|
||||
|
||||
```erb
|
||||
<% # Template Dependency: recordings/threads/events/subscribers_changed %>
|
||||
<% # Template Dependency: recordings/threads/events/completed %>
|
||||
<% # Template Dependency: recordings/threads/events/uncompleted %>
|
||||
```
|
||||
|
||||
Into:
|
||||
|
||||
```erb
|
||||
<% # Template Dependency: recordings/threads/events/* %>
|
||||
```
|
||||
|
||||
*Kasper Timm Hansen*
|
||||
|
||||
* Allow defining explicit collection caching using a `# Template Collection: ...`
|
||||
directive inside templates.
|
||||
|
||||
*Dov Murik*
|
||||
|
||||
* Asset helpers raise `ArgumentError` when `nil` is passed as a source.
|
||||
|
||||
*Anton Kolomiychuk*
|
||||
|
||||
* Always attach the template digest to the cache key for collection caching
|
||||
even when `virtual_path` is not available from the view context.
|
||||
Which could happen if the rendering was done directly in the controller
|
||||
and not in a template.
|
||||
|
||||
Fixes #20535.
|
||||
|
||||
*Roque Pinel*
|
||||
|
||||
* Improve detection of partial templates eligible for collection caching,
|
||||
now allowing multi-line comments at the beginning of the template file.
|
||||
|
||||
*Dov Murik*
|
||||
|
||||
* Raise an `ArgumentError` when a false value for `include_blank` is passed to a
|
||||
required select field (to comply with the HTML5 spec).
|
||||
|
||||
*Grey Baker*
|
||||
|
||||
* Do not put partial name to `local_assigns` when rendering without
|
||||
an object or a collection.
|
||||
|
||||
*Henrik Nygren*
|
||||
|
||||
* Remove `:rescue_format` option for `translate` helper since it's no longer
|
||||
supported by I18n.
|
||||
|
||||
*Bernard Potocki*
|
||||
|
||||
* `translate` should handle `raise` flag correctly in case of both main and default
|
||||
translation is missing.
|
||||
|
||||
Fixes #19967.
|
||||
|
||||
*Bernard Potocki*
|
||||
|
||||
* Load the `default_form_builder` from the controller on initialization, which overrides
|
||||
the global config if it is present.
|
||||
|
||||
*Kevin McPhillips*
|
||||
|
||||
* Accept lambda as `child_index` option in `fields_for` method.
|
||||
|
||||
*Karol Galanciak*
|
||||
|
||||
* `translate` allows `default: [[]]` again for a default value of `[]`.
|
||||
|
||||
Fixes #19640.
|
||||
|
||||
*Adam Prescott*
|
||||
|
||||
* `translate` should accept nils as members of the `:default`
|
||||
parameter without raising a translation missing error.
|
||||
|
||||
Fixes #19419.
|
||||
|
||||
*Justin Coyne*
|
||||
|
||||
* `number_to_percentage` does not crash with `Float::NAN` or `Float::INFINITY`
|
||||
as input when `precision: 0` is used.
|
||||
|
||||
Fixes #19227.
|
||||
|
||||
*Yves Senn*
|
||||
|
||||
* Fixed the translation helper method to accept different default values types
|
||||
besides String.
|
||||
|
||||
*Ulisses Almeida*
|
||||
|
||||
* Fixed a dependency tracker bug that caused template dependencies not
|
||||
count layouts as dependencies for partials.
|
||||
|
||||
*Juho Leinonen*
|
||||
|
||||
* Extracted `ActionView::Helpers::RecordTagHelper` to external gem
|
||||
(`record_tag_helper`) and added removal notices.
|
||||
|
||||
*Todd Bealmear*
|
||||
|
||||
* Allow to pass a string value to `size` option in `image_tag` and `video_tag`.
|
||||
|
||||
This makes the behavior more consistent with `width` or `height` options.
|
||||
|
||||
*Mehdi Lahmam*
|
||||
|
||||
* Partial template name does no more have to be a valid Ruby identifier.
|
||||
|
||||
There used to be a naming rule that the partial name should start with
|
||||
underscore, and should be followed by any combination of letters, numbers
|
||||
and underscores.
|
||||
But now we can give our partials any name starting with underscore, such as
|
||||
_🍔.html.erb.
|
||||
|
||||
*Akira Matsuda*
|
||||
|
||||
* Change the default template handler from `ERB` to `Raw`.
|
||||
|
||||
Files without a template handler in their extension will be rendered using the raw
|
||||
handler instead of ERB. The raw handler does not flag the rendered text as html safe,
|
||||
so if your application rendered plain JS or HTML files before, you'll have to replace:
|
||||
|
||||
```erb
|
||||
<%= render '/common/analytics.js' %>
|
||||
```
|
||||
|
||||
with either
|
||||
|
||||
```erb
|
||||
<%= raw render '/common/analytics.js' %>
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```erb
|
||||
<%= render('/common/analytics.js').html_safe %>
|
||||
```
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `AbstractController::Base::parent_prefixes`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Default translations that have a lower precedence than a html safe default,
|
||||
but are not themselves safe, should not be marked as html_safe.
|
||||
|
||||
*Justin Coyne*
|
||||
|
||||
* Make possible to use blocks with short version of `render "partial"` helper.
|
||||
|
||||
*Nikolay Shebanov*
|
||||
|
||||
* Add a `hidden_field` on the `file_field` to avoid raising an error when the only
|
||||
input on the form is the `file_field`.
|
||||
|
||||
*Mauro George*
|
||||
|
||||
* Add an explicit error message, in `ActionView::PartialRenderer` for partial
|
||||
`rendering`, when the value of option `as` has invalid characters.
|
||||
|
||||
*Angelo Capilleri*
|
||||
|
||||
* Allow entries without a link tag in `AtomFeedHelper`.
|
||||
|
||||
*Daniel Gomez de Souza*
|
||||
|
||||
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/actionview/CHANGELOG.md) for previous changes.
|
||||
Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/actionview/CHANGELOG.md) for previous changes.
|
||||
|
|
|
@ -6,9 +6,9 @@ module ActionView
|
|||
|
||||
module VERSION
|
||||
MAJOR = 5
|
||||
MINOR = 0
|
||||
MINOR = 1
|
||||
TINY = 0
|
||||
PRE = "rc1"
|
||||
PRE = "alpha"
|
||||
|
||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||
end
|
||||
|
|
|
@ -1,184 +1,2 @@
|
|||
## Rails 5.0.0.rc1 (May 06, 2016) ##
|
||||
|
||||
* No changes.
|
||||
|
||||
|
||||
## Rails 5.0.0.beta4 (April 27, 2016) ##
|
||||
|
||||
* Enable class reloading prior to job dispatch, and ensure Active Record
|
||||
connections are returned to the pool when jobs are run in separate threads.
|
||||
|
||||
*Matthew Draper*
|
||||
|
||||
* Tune the async adapter for low-footprint dev/test usage. Use a single
|
||||
thread pool for all queues and limit to 0 to #CPU total threads, down from
|
||||
2 to 10*#CPU per queue.
|
||||
|
||||
*Jeremy Daer*
|
||||
|
||||
|
||||
## Rails 5.0.0.beta3 (February 24, 2016) ##
|
||||
|
||||
* Change the default adapter from inline to async. It's a better default as tests will then not mistakenly
|
||||
come to rely on behavior happening synchronously. This is especially important with things like jobs kicked off
|
||||
in Active Record lifecycle callbacks.
|
||||
|
||||
*DHH*
|
||||
|
||||
|
||||
## Rails 5.0.0.beta2 (February 01, 2016) ##
|
||||
|
||||
* No changes.
|
||||
|
||||
|
||||
## Rails 5.0.0.beta1 (December 18, 2015) ##
|
||||
|
||||
* Fixed serializing `:at` option for `assert_enqueued_with`
|
||||
and `assert_performed_with`.
|
||||
|
||||
*Wojciech Wnętrzak*
|
||||
|
||||
* Support passing array to `assert_enqueued_jobs` in `:only` option.
|
||||
|
||||
*Wojciech Wnętrzak*
|
||||
|
||||
* Add job priorities to Active Job.
|
||||
|
||||
*wvengen*
|
||||
|
||||
* Implement a simple `AsyncJob` processor and associated `AsyncAdapter` that
|
||||
queue jobs to a `concurrent-ruby` thread pool.
|
||||
|
||||
*Jerry D'Antonio*
|
||||
|
||||
* Implement `provider_job_id` for `queue_classic` adapter. This requires the
|
||||
latest, currently unreleased, version of queue_classic.
|
||||
|
||||
*Yves Senn*
|
||||
|
||||
* `assert_enqueued_with` and `assert_performed_with` now returns the matched
|
||||
job instance for further assertions.
|
||||
|
||||
*Jean Boussier*
|
||||
|
||||
* Include `I18n.locale` into job serialization/deserialization and use it around
|
||||
`perform`.
|
||||
|
||||
Fixes #20799.
|
||||
|
||||
*Johannes Opper*
|
||||
|
||||
* Allow `DelayedJob`, `Sidekiq`, `qu`, and `que` to report the job id back to
|
||||
`ActiveJob::Base` as `provider_job_id`.
|
||||
|
||||
Fixes #18821.
|
||||
|
||||
*Kevin Deisz*, *Jeroen van Baarsen*
|
||||
|
||||
* `assert_enqueued_jobs` and `assert_performed_jobs` in block form use the
|
||||
given number as expected value. This makes the error message much easier to
|
||||
understand.
|
||||
|
||||
*y-yagi*
|
||||
|
||||
* A generated job now inherits from `app/jobs/application_job.rb` by default.
|
||||
|
||||
*Jeroen van Baarsen*
|
||||
|
||||
* Add ability to configure the queue adapter on a per job basis.
|
||||
|
||||
Now different jobs can have different queue adapters without conflicting with
|
||||
each other.
|
||||
|
||||
Example:
|
||||
|
||||
class EmailJob < ActiveJob::Base
|
||||
self.queue_adapter = :sidekiq
|
||||
end
|
||||
|
||||
class ImageProcessingJob < ActiveJob::Base
|
||||
self.queue_adapter = :delayed_job
|
||||
end
|
||||
|
||||
*tamird*
|
||||
|
||||
* Add an `:only` option to `perform_enqueued_jobs` to filter jobs based on
|
||||
type.
|
||||
|
||||
This allows specific jobs to be tested, while preventing others from
|
||||
being performed unnecessarily.
|
||||
|
||||
Example:
|
||||
|
||||
def test_hello_job
|
||||
assert_performed_jobs 1, only: HelloJob do
|
||||
HelloJob.perform_later('jeremy')
|
||||
LoggingJob.perform_later
|
||||
end
|
||||
end
|
||||
|
||||
An array may also be specified, to support testing multiple jobs.
|
||||
|
||||
Example:
|
||||
|
||||
def test_hello_and_logging_jobs
|
||||
assert_nothing_raised do
|
||||
assert_performed_jobs 2, only: [HelloJob, LoggingJob] do
|
||||
HelloJob.perform_later('jeremy')
|
||||
LoggingJob.perform_later('stewie')
|
||||
RescueJob.perform_later('david')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Fixes #18802.
|
||||
|
||||
*Michael Ryan*
|
||||
|
||||
* Allow keyword arguments to be used with Active Job.
|
||||
|
||||
Fixes #18741.
|
||||
|
||||
*Sean Griffin*
|
||||
|
||||
* Add `:only` option to `assert_enqueued_jobs`, to check the number of times
|
||||
a specific kind of job is enqueued.
|
||||
|
||||
Example:
|
||||
|
||||
def test_logging_job
|
||||
assert_enqueued_jobs 1, only: LoggingJob do
|
||||
LoggingJob.perform_later
|
||||
HelloJob.perform_later('jeremy')
|
||||
end
|
||||
end
|
||||
|
||||
*George Claghorn*
|
||||
|
||||
* `ActiveJob::Base.deserialize` delegates to the job class.
|
||||
|
||||
Since `ActiveJob::Base#deserialize` can be overridden by subclasses (like
|
||||
`ActiveJob::Base#serialize`) this allows jobs to attach arbitrary metadata
|
||||
when they get serialized and read it back when they get performed.
|
||||
|
||||
Example:
|
||||
|
||||
class DeliverWebhookJob < ActiveJob::Base
|
||||
def serialize
|
||||
super.merge('attempt_number' => (@attempt_number || 0) + 1)
|
||||
end
|
||||
|
||||
def deserialize(job_data)
|
||||
super
|
||||
@attempt_number = job_data['attempt_number']
|
||||
end
|
||||
|
||||
rescue_from(TimeoutError) do |exception|
|
||||
raise exception if @attempt_number > 5
|
||||
retry_job(wait: 10)
|
||||
end
|
||||
end
|
||||
|
||||
*Isaac Seymour*
|
||||
|
||||
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/activejob/CHANGELOG.md) for previous changes.
|
||||
Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/activejob/CHANGELOG.md) for previous changes.
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require 'rake/testtask'
|
||||
|
||||
ACTIVEJOB_ADAPTERS = %w(async inline delayed_job qu que queue_classic resque sidekiq sneakers sucker_punch backburner test)
|
||||
#TODO: add qu back to the list after it support Rails 5.1
|
||||
ACTIVEJOB_ADAPTERS = %w(async inline delayed_job que queue_classic resque sidekiq sneakers sucker_punch backburner test)
|
||||
ACTIVEJOB_ADAPTERS -= %w(queue_classic) if defined?(JRUBY_VERSION)
|
||||
|
||||
task default: :test
|
||||
|
|
|
@ -6,9 +6,9 @@ module ActiveJob
|
|||
|
||||
module VERSION
|
||||
MAJOR = 5
|
||||
MINOR = 0
|
||||
MINOR = 1
|
||||
TINY = 0
|
||||
PRE = "rc1"
|
||||
PRE = "alpha"
|
||||
|
||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||
end
|
||||
|
|
|
@ -1,156 +1,2 @@
|
|||
## Rails 5.0.0.rc1 (May 06, 2016) ##
|
||||
|
||||
* No changes.
|
||||
|
||||
|
||||
## Rails 5.0.0.beta4 (April 27, 2016) ##
|
||||
|
||||
* Allow passing record being validated to the message proc to generate
|
||||
customized error messages for that object using I18n helper.
|
||||
|
||||
*Prathamesh Sonpatki*
|
||||
|
||||
## Rails 5.0.0.beta3 (February 24, 2016) ##
|
||||
|
||||
* No changes.
|
||||
|
||||
|
||||
## Rails 5.0.0.beta2 (February 01, 2016) ##
|
||||
|
||||
* No changes.
|
||||
|
||||
|
||||
## Rails 5.0.0.beta1 (December 18, 2015) ##
|
||||
|
||||
* Validate multiple contexts on `valid?` and `invalid?` at once.
|
||||
|
||||
Example:
|
||||
|
||||
class Person
|
||||
include ActiveModel::Validations
|
||||
|
||||
attr_reader :name, :title
|
||||
validates_presence_of :name, on: :create
|
||||
validates_presence_of :title, on: :update
|
||||
end
|
||||
|
||||
person = Person.new
|
||||
person.valid?([:create, :update]) # => false
|
||||
person.errors.messages # => {:name=>["can't be blank"], :title=>["can't be blank"]}
|
||||
|
||||
*Dmitry Polushkin*
|
||||
|
||||
* Add case_sensitive option for confirmation validator in models.
|
||||
|
||||
*Akshat Sharma*
|
||||
|
||||
* Ensure `method_missing` is called for methods passed to
|
||||
`ActiveModel::Serialization#serializable_hash` that don't exist.
|
||||
|
||||
*Jay Elaraj*
|
||||
|
||||
* Remove `ActiveModel::Serializers::Xml` from core.
|
||||
|
||||
*Zachary Scott*
|
||||
|
||||
* Add `ActiveModel::Dirty#[attr_name]_previously_changed?` and
|
||||
`ActiveModel::Dirty#[attr_name]_previous_change` to improve access
|
||||
to recorded changes after the model has been saved.
|
||||
|
||||
It makes the dirty-attributes query methods consistent before and after
|
||||
saving.
|
||||
|
||||
*Fernando Tapia Rico*
|
||||
|
||||
* Deprecate the `:tokenizer` option for `validates_length_of`, in favor of
|
||||
plain Ruby.
|
||||
|
||||
*Sean Griffin*
|
||||
|
||||
* Deprecate `ActiveModel::Errors#add_on_empty` and `ActiveModel::Errors#add_on_blank`
|
||||
with no replacement.
|
||||
|
||||
*Wojciech Wnętrzak*
|
||||
|
||||
* Deprecate `ActiveModel::Errors#get`, `ActiveModel::Errors#set` and
|
||||
`ActiveModel::Errors#[]=` methods that have inconsistent behavior.
|
||||
|
||||
*Wojciech Wnętrzak*
|
||||
|
||||
* Allow symbol as values for `tokenize` of `LengthValidator`.
|
||||
|
||||
*Kensuke Naito*
|
||||
|
||||
* Assigning an unknown attribute key to an `ActiveModel` instance during initialization
|
||||
will now raise `ActiveModel::AttributeAssignment::UnknownAttributeError` instead of
|
||||
`NoMethodError`.
|
||||
|
||||
Example:
|
||||
|
||||
User.new(foo: 'some value')
|
||||
# => ActiveModel::AttributeAssignment::UnknownAttributeError: unknown attribute 'foo' for User.
|
||||
|
||||
*Eugene Gilburg*
|
||||
|
||||
* Extracted `ActiveRecord::AttributeAssignment` to `ActiveModel::AttributeAssignment`
|
||||
allowing to use it for any object as an includable module.
|
||||
|
||||
Example:
|
||||
|
||||
class Cat
|
||||
include ActiveModel::AttributeAssignment
|
||||
attr_accessor :name, :status
|
||||
end
|
||||
|
||||
cat = Cat.new
|
||||
cat.assign_attributes(name: "Gorby", status: "yawning")
|
||||
cat.name # => 'Gorby'
|
||||
cat.status # => 'yawning'
|
||||
cat.assign_attributes(status: "sleeping")
|
||||
cat.name # => 'Gorby'
|
||||
cat.status # => 'sleeping'
|
||||
|
||||
*Bogdan Gusiev*
|
||||
|
||||
* Add `ActiveModel::Errors#details`
|
||||
|
||||
To be able to return type of used validator, one can now call `details`
|
||||
on errors instance.
|
||||
|
||||
Example:
|
||||
|
||||
class User < ActiveRecord::Base
|
||||
validates :name, presence: true
|
||||
end
|
||||
|
||||
user = User.new; user.valid?; user.errors.details
|
||||
=> {name: [{error: :blank}]}
|
||||
|
||||
*Wojciech Wnętrzak*
|
||||
|
||||
* Change `validates_acceptance_of` to accept `true` by default besides `'1'`.
|
||||
|
||||
The default for `validates_acceptance_of` is now `'1'` and `true`.
|
||||
In the past, only `"1"` was the default and you were required to pass
|
||||
`accept: true` separately.
|
||||
|
||||
*mokhan*
|
||||
|
||||
* Remove deprecated `ActiveModel::Dirty#reset_#{attribute}` and
|
||||
`ActiveModel::Dirty#reset_changes`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Change the way in which callback chains can be halted.
|
||||
|
||||
The preferred method to halt a callback chain from now on is to explicitly
|
||||
`throw(:abort)`.
|
||||
In the past, returning `false` in an Active Model `before_` callback had
|
||||
the side effect of halting the callback chain.
|
||||
This is not recommended anymore and, depending on the value of the
|
||||
`ActiveSupport.halt_callback_chains_on_return_false` option, will
|
||||
either not work at all or display a deprecation warning.
|
||||
|
||||
*claudiob*
|
||||
|
||||
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/activemodel/CHANGELOG.md) for previous changes.
|
||||
Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/activemodel/CHANGELOG.md) for previous changes.
|
||||
|
|
|
@ -6,9 +6,9 @@ module ActiveModel
|
|||
|
||||
module VERSION
|
||||
MAJOR = 5
|
||||
MINOR = 0
|
||||
MINOR = 1
|
||||
TINY = 0
|
||||
PRE = "rc1"
|
||||
PRE = "alpha"
|
||||
|
||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||
end
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -6,9 +6,9 @@ module ActiveRecord
|
|||
|
||||
module VERSION
|
||||
MAJOR = 5
|
||||
MINOR = 0
|
||||
MINOR = 1
|
||||
TINY = 0
|
||||
PRE = "rc1"
|
||||
PRE = "alpha"
|
||||
|
||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||
end
|
||||
|
|
|
@ -1,765 +1,2 @@
|
|||
## Rails 5.0.0.rc1 (May 06, 2016) ##
|
||||
|
||||
* `ActiveSupport::Duration` supports weeks and hours.
|
||||
|
||||
[1.hour.inspect, 1.hour.value, 1.hour.parts]
|
||||
# => ["3600 seconds", 3600, [[:seconds, 3600]]] # Before
|
||||
# => ["1 hour", 3600, [[:hours, 1]]] # After
|
||||
|
||||
[1.week.inspect, 1.week.value, 1.week.parts]
|
||||
# => ["7 days", 604800, [[:days, 7]]] # Before
|
||||
# => ["1 week", 604800, [[:weeks, 1]]] # After
|
||||
|
||||
This brings us into closer conformance with ISO8601 and relieves some
|
||||
astonishment about getting `1.hour.inspect # => 3600 seconds`.
|
||||
|
||||
Compatibility: The duration's `value` remains the same, so apps using
|
||||
durations are oblivious to the new time periods. Apps, libraries, and
|
||||
plugins that work with the internal `parts` hash will need to broaden
|
||||
their time period handling to cover hours & weeks.
|
||||
|
||||
*Andrey Novikov*
|
||||
|
||||
## Rails 5.0.0.beta4 (April 27, 2016) ##
|
||||
|
||||
* Time zones: Ensure that the UTC offset reflects DST changes that occurred
|
||||
since the app started. Removes UTC offset caching, reducing performance,
|
||||
but this is still relatively quick and isn't in any hot paths.
|
||||
|
||||
*Alexey Shein*
|
||||
|
||||
* Make `getlocal` and `getutc` always return instances of `Time` for
|
||||
`ActiveSupport::TimeWithZone` and `DateTime`. This eliminates a possible
|
||||
stack level too deep error in `to_time` where `ActiveSupport::TimeWithZone`
|
||||
was wrapping a `DateTime` instance. As a consequence of this the internal
|
||||
time value in `ActiveSupport::TimeWithZone` is now always an instance of
|
||||
`Time` in the UTC timezone, whether that's as the UTC time directly or
|
||||
a representation of the local time in the timezone. There should be no
|
||||
consequences of this internal change and if there are it's a bug due to
|
||||
leaky abstractions.
|
||||
|
||||
*Andrew White*
|
||||
|
||||
* Add `DateTime#subsec` to return the fraction of a second as a `Rational`.
|
||||
|
||||
*Andrew White*
|
||||
|
||||
* Add additional aliases for `DateTime#utc` to mirror the ones on
|
||||
`ActiveSupport::TimeWithZone` and `Time`.
|
||||
|
||||
*Andrew White*
|
||||
|
||||
* Add `DateTime#localtime` to return an instance of `Time` in the system's
|
||||
local timezone. Also aliased to `getlocal`.
|
||||
|
||||
*Andrew White*, *Yuichiro Kaneko*
|
||||
|
||||
* Add `Time#sec_fraction` to return the fraction of a second as a `Rational`.
|
||||
|
||||
*Andrew White*
|
||||
|
||||
* Add `ActiveSupport.to_time_preserves_timezone` config option to control
|
||||
how `to_time` handles timezones. In Ruby 2.4+ the behavior will change
|
||||
from converting to the local system timezone, to preserving the timezone
|
||||
of the receiver. This config option defaults to false so that apps made
|
||||
with earlier versions of Rails are not affected when upgrading, e.g:
|
||||
|
||||
>> ENV['TZ'] = 'US/Eastern'
|
||||
|
||||
>> "2016-04-23T10:23:12.000Z".to_time
|
||||
=> "2016-04-23T06:23:12.000-04:00"
|
||||
|
||||
>> ActiveSupport.to_time_preserves_timezone = true
|
||||
|
||||
>> "2016-04-23T10:23:12.000Z".to_time
|
||||
=> "2016-04-23T10:23:12.000Z"
|
||||
|
||||
Fixes #24617.
|
||||
|
||||
*Andrew White*
|
||||
|
||||
* `ActiveSupport::TimeZone.country_zones(country_code)` looks up the
|
||||
country's time zones by its two-letter ISO3166 country code, e.g.
|
||||
|
||||
>> ActiveSupport::TimeZone.country_zones(:jp).map(&:to_s)
|
||||
=> ["(GMT+09:00) Osaka"]
|
||||
|
||||
>> ActiveSupport::TimeZone.country_zones(:uy).map(&:to_s)
|
||||
=> ["(GMT-03:00) Montevideo"]
|
||||
|
||||
*Andrey Novikov*
|
||||
|
||||
* `Array#sum` compat with Ruby 2.4's native method.
|
||||
|
||||
Ruby 2.4 introduces `Array#sum`, but it only supports numeric elements,
|
||||
breaking our `Enumerable#sum` which supports arbitrary `Object#+`.
|
||||
To fix, override `Array#sum` with our compatible implementation.
|
||||
|
||||
Native Ruby 2.4:
|
||||
|
||||
%w[ a b ].sum
|
||||
# => TypeError: String can't be coerced into Fixnum
|
||||
|
||||
With `Enumerable#sum` shim:
|
||||
|
||||
%w[ a b ].sum
|
||||
# => 'ab'
|
||||
|
||||
We tried shimming the fast path and falling back to the compatible path
|
||||
if it fails, but that ends up slower even in simple cases due to the cost
|
||||
of exception handling. Our only choice is to override the native `Array#sum`
|
||||
with our `Enumerable#sum`.
|
||||
|
||||
*Jeremy Daer*
|
||||
|
||||
* `ActiveSupport::Duration` supports ISO8601 formatting and parsing.
|
||||
|
||||
ActiveSupport::Duration.parse('P3Y6M4DT12H30M5S')
|
||||
# => 3 years, 6 months, 4 days, 12 hours, 30 minutes, and 5 seconds
|
||||
|
||||
(3.years + 3.days).iso8601
|
||||
# => "P3Y3D"
|
||||
|
||||
Inspired by Arnau Siches' [ISO8601 gem](https://github.com/arnau/ISO8601/)
|
||||
and rewritten by Andrey Novikov with suggestions from Andrew White. Test
|
||||
data from the ISO8601 gem redistributed under MIT license.
|
||||
|
||||
(Will be used to support the PostgreSQL interval data type.)
|
||||
|
||||
*Andrey Novikov*, *Arnau Siches*, *Andrew White*
|
||||
|
||||
* `Cache#fetch(key, force: true)` forces a cache miss, so it must be called
|
||||
with a block to provide a new value to cache. Fetching with `force: true`
|
||||
but without a block now raises ArgumentError.
|
||||
|
||||
cache.fetch('key', force: true) # => ArgumentError
|
||||
|
||||
*Santosh Wadghule*
|
||||
|
||||
* Fix behavior of JSON encoding for `Exception`.
|
||||
|
||||
*namusyaka*
|
||||
|
||||
* Make `number_to_phone` format number with regexp pattern.
|
||||
|
||||
number_to_phone(18812345678, pattern: /(\d{3})(\d{4})(\d{4})/)
|
||||
# => 188-1234-5678
|
||||
|
||||
*Pan Gaoyong*
|
||||
|
||||
* Match `String#to_time`'s behaviour to that of ruby's implementation for edge cases.
|
||||
|
||||
`nil` is now returned instead of the current date if the string provided does
|
||||
contain time information, but none that is used to build the `Time` object.
|
||||
|
||||
Fixes #22958.
|
||||
|
||||
*Siim Liiser*
|
||||
|
||||
* Rely on the native DateTime#<=> implementation to handle non-datetime like
|
||||
objects instead of returning `nil` ourselves. This restores the ability
|
||||
of `DateTime` instances to be compared with a `Numeric` that represents an
|
||||
astronomical julian day number.
|
||||
|
||||
Fixes #24228.
|
||||
|
||||
*Andrew White*
|
||||
|
||||
* Add `String#upcase_first` method.
|
||||
|
||||
*Glauco Custódio*, *bogdanvlviv*
|
||||
|
||||
* Prevent `Marshal.load` from looping infinitely when trying to autoload a constant
|
||||
which resolves to a different name.
|
||||
|
||||
*Olek Janiszewski*
|
||||
|
||||
* Deprecate `Module.local_constants`. Please use `Module.constants(false)` instead.
|
||||
|
||||
*Yuichiro Kaneko*
|
||||
|
||||
* Publish `ActiveSupport::Executor` and `ActiveSupport::Reloader` APIs to allow
|
||||
components and libraries to manage, and participate in, the execution of
|
||||
application code, and the application reloading process.
|
||||
|
||||
*Matthew Draper*
|
||||
|
||||
|
||||
## Rails 5.0.0.beta3 (February 24, 2016) ##
|
||||
|
||||
* Deprecate arguments on `assert_nothing_raised`.
|
||||
|
||||
`assert_nothing_raised` does not assert the arguments that have been passed
|
||||
in (usually a specific exception class) since the method only yields the
|
||||
block. So as not to confuse the users that the arguments have meaning, they
|
||||
are being deprecated.
|
||||
|
||||
*Tara Scherner de la Fuente*
|
||||
|
||||
* Make `benchmark('something', silence: true)` actually work.
|
||||
|
||||
*DHH*
|
||||
|
||||
* Add `#on_weekday?` method to `Date`, `Time`, and `DateTime`.
|
||||
|
||||
`#on_weekday?` returns `true` if the receiving date/time does not fall on a Saturday
|
||||
or Sunday.
|
||||
|
||||
*Vipul A M*
|
||||
|
||||
* Add `Array#second_to_last` and `Array#third_to_last` methods.
|
||||
|
||||
*Brian Christian*
|
||||
|
||||
* Fix regression in `Hash#dig` for HashWithIndifferentAccess.
|
||||
|
||||
*Jon Moss*
|
||||
|
||||
|
||||
## Rails 5.0.0.beta2 (February 01, 2016) ##
|
||||
|
||||
* Change `number_to_currency` behavior for checking negativity.
|
||||
|
||||
Used `to_f.negative` instead of using `to_f.phase` for checking negativity
|
||||
of a number in number_to_currency helper.
|
||||
This change works same for all cases except when number is "-0.0".
|
||||
|
||||
-0.0.to_f.negative? => false
|
||||
-0.0.to_f.phase? => 3.14
|
||||
|
||||
This change reverts changes from https://github.com/rails/rails/pull/6512.
|
||||
But it should be acceptable as we could not find any currency which
|
||||
supports negative zeros.
|
||||
|
||||
*Prathamesh Sonpatki*, *Rafael Mendonça França*
|
||||
|
||||
* Match `HashWithIndifferentAccess#default`'s behaviour with `Hash#default`.
|
||||
|
||||
*David Cornu*
|
||||
|
||||
* Adds `:exception_object` key to `ActiveSupport::Notifications::Instrumenter`
|
||||
payload when an exception is raised.
|
||||
|
||||
Adds new key/value pair to payload when an exception is raised:
|
||||
e.g. `:exception_object => #<RuntimeError: FAIL>`.
|
||||
|
||||
*Ryan T. Hosford*
|
||||
|
||||
* Support extended grapheme clusters and UAX 29.
|
||||
|
||||
*Adam Roben*
|
||||
|
||||
* Add petabyte and exabyte numeric conversion.
|
||||
|
||||
*Akshay Vishnoi*
|
||||
|
||||
|
||||
## Rails 5.0.0.beta1 (December 18, 2015) ##
|
||||
|
||||
* Add thread_m/cattr_accessor/reader/writer suite of methods for declaring class and module variables that live per-thread.
|
||||
This makes it easy to declare per-thread globals that are encapsulated. Note: This is a sharp edge. A wild proliferation
|
||||
of globals is A Bad Thing. But like other sharp tools, when it's right, it's right.
|
||||
|
||||
Here's an example of a simple event tracking system where the object being tracked needs not pass a creator that it
|
||||
doesn't need itself along:
|
||||
|
||||
module Current
|
||||
thread_mattr_accessor :account
|
||||
thread_mattr_accessor :user
|
||||
|
||||
def self.reset() self.account = self.user = nil end
|
||||
end
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
before_action :set_current
|
||||
after_action { Current.reset }
|
||||
|
||||
private
|
||||
def set_current
|
||||
Current.account = Account.find(params[:account_id])
|
||||
Current.user = Current.account.users.find(params[:user_id])
|
||||
end
|
||||
end
|
||||
|
||||
class MessagesController < ApplicationController
|
||||
def create
|
||||
@message = Message.create!(message_params)
|
||||
end
|
||||
end
|
||||
|
||||
class Message < ApplicationRecord
|
||||
has_many :events
|
||||
after_create :track_created
|
||||
|
||||
private
|
||||
def track_created
|
||||
events.create! origin: self, action: :create
|
||||
end
|
||||
end
|
||||
|
||||
class Event < ApplicationRecord
|
||||
belongs_to :creator, class_name: 'User'
|
||||
before_validation { self.creator ||= Current.user }
|
||||
end
|
||||
|
||||
*DHH*
|
||||
|
||||
|
||||
* Deprecated `Module#qualified_const_` in favour of the builtin Module#const_
|
||||
methods.
|
||||
|
||||
*Genadi Samokovarov*
|
||||
|
||||
* Deprecate passing string to define callback.
|
||||
|
||||
*Yuichiro Kaneko*
|
||||
|
||||
* `ActiveSupport::Cache::Store#namespaced_key`,
|
||||
`ActiveSupport::Cache::MemCachedStore#escape_key`, and
|
||||
`ActiveSupport::Cache::FileStore#key_file_path`
|
||||
are deprecated and replaced with `normalize_key` that now calls `super`.
|
||||
|
||||
`ActiveSupport::Cache::LocaleCache#set_cache_value` is deprecated and replaced with `write_cache_value`.
|
||||
|
||||
*Michael Grosser*
|
||||
|
||||
* Implements an evented file watcher to asynchronously detect changes in the
|
||||
application source code, routes, locales, etc.
|
||||
|
||||
This watcher is disabled by default, applications my enable it in the configuration:
|
||||
|
||||
# config/environments/development.rb
|
||||
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
||||
|
||||
This feature depends on the [listen](https://github.com/guard/listen) gem:
|
||||
|
||||
group :development do
|
||||
gem 'listen', '~> 3.0.5'
|
||||
end
|
||||
|
||||
*Puneet Agarwal* and *Xavier Noria*
|
||||
|
||||
* Added `Time.days_in_year` to return the number of days in the given year, or the
|
||||
current year if no argument is provided.
|
||||
|
||||
*Jon Pascoe*
|
||||
|
||||
* Updated `parameterize` to preserve the case of a string, optionally.
|
||||
|
||||
Example:
|
||||
|
||||
parameterize("Donald E. Knuth", separator: '_') # => "donald_e_knuth"
|
||||
parameterize("Donald E. Knuth", preserve_case: true) # => "Donald-E-Knuth"
|
||||
|
||||
*Swaathi Kakarla*
|
||||
|
||||
* `HashWithIndifferentAccess.new` respects the default value or proc on objects
|
||||
that respond to `#to_hash`. `.new_from_hash_copying_default` simply invokes `.new`.
|
||||
All calls to `.new_from_hash_copying_default` are replaced with `.new`.
|
||||
|
||||
*Gordon Chan*
|
||||
|
||||
* Change Integer#year to return a Fixnum instead of a Float to improve
|
||||
consistency.
|
||||
|
||||
Integer#years returned a Float while the rest of the accompanying methods
|
||||
(days, weeks, months, etc.) return a Fixnum.
|
||||
|
||||
Before:
|
||||
|
||||
1.year # => 31557600.0
|
||||
|
||||
After:
|
||||
|
||||
1.year # => 31557600
|
||||
|
||||
*Konstantinos Rousis*
|
||||
|
||||
* Handle invalid UTF-8 strings when HTML escaping.
|
||||
|
||||
Use `ActiveSupport::Multibyte::Unicode.tidy_bytes` to handle invalid UTF-8
|
||||
strings in `ERB::Util.unwrapped_html_escape` and `ERB::Util.html_escape_once`.
|
||||
Prevents user-entered input passed from a querystring into a form field from
|
||||
causing invalid byte sequence errors.
|
||||
|
||||
*Grey Baker*
|
||||
|
||||
* Update `ActiveSupport::Multibyte::Chars#slice!` to return `nil` if the
|
||||
arguments are out of bounds, to mirror the behavior of `String#slice!`
|
||||
|
||||
*Gourav Tiwari*
|
||||
|
||||
* Fix `number_to_human` so that 999999999 rounds to "1 Billion" instead of
|
||||
"1000 Million".
|
||||
|
||||
*Max Jacobson*
|
||||
|
||||
* Fix `ActiveSupport::Deprecation#deprecate_methods` to report using the
|
||||
current deprecator instance, where applicable.
|
||||
|
||||
*Brandon Dunne*
|
||||
|
||||
* `Cache#fetch` instrumentation marks whether it was a `:hit`.
|
||||
|
||||
*Robin Clowers*
|
||||
|
||||
* `assert_difference` and `assert_no_difference` now returns the result of the
|
||||
yielded block.
|
||||
|
||||
Example:
|
||||
|
||||
post = assert_difference -> { Post.count }, 1 do
|
||||
Post.create
|
||||
end
|
||||
|
||||
*Lucas Mazza*
|
||||
|
||||
* Short-circuit `blank?` on date and time values since they are never blank.
|
||||
|
||||
Fixes #21657.
|
||||
|
||||
*Andrew White*
|
||||
|
||||
* Replaced deprecated `ThreadSafe::Cache` with its successor `Concurrent::Map` now that
|
||||
the thread_safe gem has been merged into concurrent-ruby.
|
||||
|
||||
*Jerry D'Antonio*
|
||||
|
||||
* Updated Unicode version to 8.0.0
|
||||
|
||||
*Anshul Sharma*
|
||||
|
||||
* `number_to_currency` and `number_with_delimiter` now accept custom `delimiter_pattern` option
|
||||
to handle placement of delimiter, to support currency formats like INR
|
||||
|
||||
Example:
|
||||
|
||||
number_to_currency(1230000, delimiter_pattern: /(\d+?)(?=(\d\d)+(\d)(?!\d))/, unit: '₹', format: "%u %n")
|
||||
# => '₹ 12,30,000.00'
|
||||
|
||||
*Vipul A M*
|
||||
|
||||
* Deprecate `:prefix` option of `number_to_human_size` with no replacement.
|
||||
|
||||
*Jean Boussier*
|
||||
|
||||
* Fix `TimeWithZone#eql?` to properly handle `TimeWithZone` created from `DateTime`:
|
||||
twz = DateTime.now.in_time_zone
|
||||
twz.eql?(twz.dup) => true
|
||||
|
||||
Fixes #14178.
|
||||
|
||||
*Roque Pinel*
|
||||
|
||||
* ActiveSupport::HashWithIndifferentAccess `select` and `reject` will now return
|
||||
enumerator if called without block.
|
||||
|
||||
Fixes #20095.
|
||||
|
||||
*Bernard Potocki*
|
||||
|
||||
* Removed `ActiveSupport::Concurrency::Latch`, superseded by `Concurrent::CountDownLatch`
|
||||
from the concurrent-ruby gem.
|
||||
|
||||
*Jerry D'Antonio*
|
||||
|
||||
* Fix not calling `#default` on `HashWithIndifferentAccess#to_hash` when only
|
||||
`default_proc` is set, which could raise.
|
||||
|
||||
*Simon Eskildsen*
|
||||
|
||||
* Fix setting `default_proc` on `HashWithIndifferentAccess#dup`.
|
||||
|
||||
*Simon Eskildsen*
|
||||
|
||||
* Fix a range of values for parameters of the Time#change.
|
||||
|
||||
*Nikolay Kondratyev*
|
||||
|
||||
* Add `Enumerable#pluck` to get the same values from arrays as from ActiveRecord
|
||||
associations.
|
||||
|
||||
Fixes #20339.
|
||||
|
||||
*Kevin Deisz*
|
||||
|
||||
* Add a bang version to `ActiveSupport::OrderedOptions` get methods which will raise
|
||||
an `KeyError` if the value is `.blank?`.
|
||||
|
||||
Before:
|
||||
|
||||
if (slack_url = Rails.application.secrets.slack_url).present?
|
||||
# Do something worthwhile
|
||||
else
|
||||
# Raise as important secret password is not specified
|
||||
end
|
||||
|
||||
After:
|
||||
|
||||
slack_url = Rails.application.secrets.slack_url!
|
||||
|
||||
*Aditya Sanghi*, *Gaurish Sharma*
|
||||
|
||||
* Remove deprecated `Class#superclass_delegating_accessor`.
|
||||
Use `Class#class_attribute` instead.
|
||||
|
||||
*Akshay Vishnoi*
|
||||
|
||||
* Patch `Delegator` to work with `#try`.
|
||||
|
||||
Fixes #5790.
|
||||
|
||||
*Nate Smith*
|
||||
|
||||
* Add `Integer#positive?` and `Integer#negative?` query methods
|
||||
in the vein of `Fixnum#zero?`.
|
||||
|
||||
This makes it nicer to do things like `bunch_of_numbers.select(&:positive?)`.
|
||||
|
||||
*DHH*
|
||||
|
||||
* Encoding `ActiveSupport::TimeWithZone` to YAML now preserves the timezone information.
|
||||
|
||||
Fixes #9183.
|
||||
|
||||
*Andrew White*
|
||||
|
||||
* Added `ActiveSupport::TimeZone#strptime` to allow parsing times as if
|
||||
from a given timezone.
|
||||
|
||||
*Paul A Jungwirth*
|
||||
|
||||
* `ActiveSupport::Callbacks#skip_callback` now raises an `ArgumentError` if
|
||||
an unrecognized callback is removed.
|
||||
|
||||
*Iain Beeston*
|
||||
|
||||
* Added `ActiveSupport::ArrayInquirer` and `Array#inquiry`.
|
||||
|
||||
Wrapping an array in an `ArrayInquirer` gives a friendlier way to check its
|
||||
contents:
|
||||
|
||||
variants = ActiveSupport::ArrayInquirer.new([:phone, :tablet])
|
||||
|
||||
variants.phone? # => true
|
||||
variants.tablet? # => true
|
||||
variants.desktop? # => false
|
||||
|
||||
variants.any?(:phone, :tablet) # => true
|
||||
variants.any?(:phone, :desktop) # => true
|
||||
variants.any?(:desktop, :watch) # => false
|
||||
|
||||
`Array#inquiry` is a shortcut for wrapping the receiving array in an
|
||||
`ArrayInquirer`.
|
||||
|
||||
*George Claghorn*
|
||||
|
||||
* Deprecate `alias_method_chain` in favour of `Module#prepend` introduced in
|
||||
Ruby 2.0.
|
||||
|
||||
*Kir Shatrov*
|
||||
|
||||
* Added `#without` on `Enumerable` and `Array` to return a copy of an
|
||||
enumerable without the specified elements.
|
||||
|
||||
*Todd Bealmear*
|
||||
|
||||
* Fixed a problem where `String#truncate_words` would get stuck with a complex
|
||||
string.
|
||||
|
||||
*Henrik Nygren*
|
||||
|
||||
* Fixed a roundtrip problem with `AS::SafeBuffer` where primitive-like strings
|
||||
will be dumped as primitives:
|
||||
|
||||
Before:
|
||||
|
||||
YAML.load ActiveSupport::SafeBuffer.new("Hello").to_yaml # => "Hello"
|
||||
YAML.load ActiveSupport::SafeBuffer.new("true").to_yaml # => true
|
||||
YAML.load ActiveSupport::SafeBuffer.new("false").to_yaml # => false
|
||||
YAML.load ActiveSupport::SafeBuffer.new("1").to_yaml # => 1
|
||||
YAML.load ActiveSupport::SafeBuffer.new("1.1").to_yaml # => 1.1
|
||||
|
||||
After:
|
||||
|
||||
YAML.load ActiveSupport::SafeBuffer.new("Hello").to_yaml # => "Hello"
|
||||
YAML.load ActiveSupport::SafeBuffer.new("true").to_yaml # => "true"
|
||||
YAML.load ActiveSupport::SafeBuffer.new("false").to_yaml # => "false"
|
||||
YAML.load ActiveSupport::SafeBuffer.new("1").to_yaml # => "1"
|
||||
YAML.load ActiveSupport::SafeBuffer.new("1.1").to_yaml # => "1.1"
|
||||
|
||||
*Godfrey Chan*
|
||||
|
||||
* Enable `number_to_percentage` to keep the number's precision by allowing
|
||||
`:precision` to be `nil`.
|
||||
|
||||
*Jack Xu*
|
||||
|
||||
* `config_accessor` became a private method, as with Ruby's `attr_accessor`.
|
||||
|
||||
*Akira Matsuda*
|
||||
|
||||
* `AS::Testing::TimeHelpers#travel_to` now changes `DateTime.now` as well as
|
||||
`Time.now` and `Date.today`.
|
||||
|
||||
*Yuki Nishijima*
|
||||
|
||||
* Add `file_fixture` to `ActiveSupport::TestCase`.
|
||||
It provides a simple mechanism to access sample files in your test cases.
|
||||
|
||||
By default file fixtures are stored in `test/fixtures/files`. This can be
|
||||
configured per test-case using the `file_fixture_path` class attribute.
|
||||
|
||||
*Yves Senn*
|
||||
|
||||
* Return value of yielded block in `File.atomic_write`.
|
||||
|
||||
*Ian Ker-Seymer*
|
||||
|
||||
* Duplicate frozen array when assigning it to a `HashWithIndifferentAccess` so
|
||||
that it doesn't raise a `RuntimeError` when calling `map!` on it in `convert_value`.
|
||||
|
||||
Fixes #18550.
|
||||
|
||||
*Aditya Kapoor*
|
||||
|
||||
* Add missing time zone definitions for Russian Federation and sync them
|
||||
with `zone.tab` file from tzdata version 2014j (latest).
|
||||
|
||||
*Andrey Novikov*
|
||||
|
||||
* Add `SecureRandom.base58` for generation of random base58 strings.
|
||||
|
||||
*Matthew Draper*, *Guillermo Iguaran*
|
||||
|
||||
* Add `#prev_day` and `#next_day` counterparts to `#yesterday` and
|
||||
`#tomorrow` for `Date`, `Time`, and `DateTime`.
|
||||
|
||||
*George Claghorn*
|
||||
|
||||
* Add `same_time` option to `#next_week` and `#prev_week` for `Date`, `Time`,
|
||||
and `DateTime`.
|
||||
|
||||
*George Claghorn*
|
||||
|
||||
* Add `#on_weekend?`, `#next_weekday`, `#prev_weekday` methods to `Date`,
|
||||
`Time`, and `DateTime`.
|
||||
|
||||
`#on_weekend?` returns `true` if the receiving date/time falls on a Saturday
|
||||
or Sunday.
|
||||
|
||||
`#next_weekday` returns a new date/time representing the next day that does
|
||||
not fall on a Saturday or Sunday.
|
||||
|
||||
`#prev_weekday` returns a new date/time representing the previous day that
|
||||
does not fall on a Saturday or Sunday.
|
||||
|
||||
*George Claghorn*
|
||||
|
||||
* Change the default test order from `:sorted` to `:random`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `ActiveSupport::JSON::Encoding::CircularReferenceError`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated methods `ActiveSupport::JSON::Encoding.encode_big_decimal_as_string=`
|
||||
and `ActiveSupport::JSON::Encoding.encode_big_decimal_as_string`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `ActiveSupport::SafeBuffer#prepend`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated methods at `Kernel`.
|
||||
|
||||
`silence_stderr`, `silence_stream`, `capture` and `quietly`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `active_support/core_ext/big_decimal/yaml_conversions`
|
||||
file.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated methods `ActiveSupport::Cache::Store.instrument` and
|
||||
`ActiveSupport::Cache::Store.instrument=`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Change the way in which callback chains can be halted.
|
||||
|
||||
The preferred method to halt a callback chain from now on is to explicitly
|
||||
`throw(:abort)`.
|
||||
In the past, callbacks could only be halted by explicitly providing a
|
||||
terminator and by having a callback match the conditions of the terminator.
|
||||
|
||||
* Add `ActiveSupport.halt_callback_chains_on_return_false`
|
||||
|
||||
Setting `ActiveSupport.halt_callback_chains_on_return_false`
|
||||
to `true` will let an app support the deprecated way of halting Active Record,
|
||||
and Active Model callback chains by returning `false`.
|
||||
|
||||
Setting the value to `false` will tell the app to ignore any `false` value
|
||||
returned by those callbacks, and only halt the chain upon `throw(:abort)`.
|
||||
|
||||
When the configuration option is missing, its value is `true`, so older apps
|
||||
ported to Rails 5.0 will not break (but display a deprecation warning).
|
||||
For new Rails 5.0 apps, its value is set to `false` in an initializer, so
|
||||
these apps will support the new behavior by default.
|
||||
|
||||
*claudiob*, *Roque Pinel*
|
||||
|
||||
* Changes arguments and default value of CallbackChain's `:terminator` option
|
||||
|
||||
Chains of callbacks defined without an explicit `:terminator` option will
|
||||
now be halted as soon as a `before_` callback throws `:abort`.
|
||||
|
||||
Chains of callbacks defined with a `:terminator` option will maintain their
|
||||
existing behavior of halting as soon as a `before_` callback matches the
|
||||
terminator's expectation.
|
||||
|
||||
*claudiob*
|
||||
|
||||
* Deprecate `MissingSourceFile` in favor of `LoadError`.
|
||||
|
||||
`MissingSourceFile` was just an alias to `LoadError` and was not being
|
||||
raised inside the framework.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Add support for error dispatcher classes in `ActiveSupport::Rescuable`.
|
||||
Now it acts closer to Ruby's rescue.
|
||||
|
||||
Example:
|
||||
|
||||
class BaseController < ApplicationController
|
||||
module ErrorDispatcher
|
||||
def self.===(other)
|
||||
Exception === other && other.respond_to?(:status)
|
||||
end
|
||||
end
|
||||
|
||||
rescue_from ErrorDispatcher do |error|
|
||||
render status: error.status, json: { error: error.to_s }
|
||||
end
|
||||
end
|
||||
|
||||
*Genadi Samokovarov*
|
||||
|
||||
* Add `#verified` and `#valid_message?` methods to `ActiveSupport::MessageVerifier`
|
||||
|
||||
Previously, the only way to decode a message with `ActiveSupport::MessageVerifier`
|
||||
was to use `#verify`, which would raise an exception on invalid messages. Now
|
||||
`#verified` can also be used, which returns `nil` on messages that cannot be
|
||||
decoded.
|
||||
|
||||
Previously, there was no way to check if a message's format was valid without
|
||||
attempting to decode it. `#valid_message?` is a boolean convenience method that
|
||||
checks whether the message is valid without actually decoding it.
|
||||
|
||||
*Logan Leger*
|
||||
|
||||
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/activesupport/CHANGELOG.md) for previous changes.
|
||||
Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/activesupport/CHANGELOG.md) for previous changes.
|
||||
|
|
|
@ -6,9 +6,9 @@ module ActiveSupport
|
|||
|
||||
module VERSION
|
||||
MAJOR = 5
|
||||
MINOR = 0
|
||||
MINOR = 1
|
||||
TINY = 0
|
||||
PRE = "rc1"
|
||||
PRE = "alpha"
|
||||
|
||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||
end
|
||||
|
|
|
@ -1,53 +1,2 @@
|
|||
## Rails 5.0.0.rc1 (May 06, 2016) ##
|
||||
|
||||
* No changes.
|
||||
|
||||
|
||||
## Rails 5.0.0.beta4 (April 27, 2016) ##
|
||||
|
||||
* Update example of passing a proc to `:message` option for validating records.
|
||||
|
||||
This behavior was recently changed in [Pull Request #24199](https://github.com/rails/rails/pull/24119) to
|
||||
pass the object being validated as first argument to the `:message` proc,
|
||||
instead of the key of the field being validated.
|
||||
|
||||
*Prathamesh Sonpatki*
|
||||
|
||||
* Added new guide: Action Cable Overview.
|
||||
|
||||
*David Kuhta*
|
||||
|
||||
|
||||
## Rails 5.0.0.beta3 (February 24, 2016) ##
|
||||
|
||||
* No changes.
|
||||
|
||||
|
||||
## Rails 5.0.0.beta2 (February 01, 2016) ##
|
||||
|
||||
* No changes.
|
||||
|
||||
|
||||
## Rails 5.0.0.beta1 (December 18, 2015) ##
|
||||
|
||||
* Add code of conduct to contributing guide.
|
||||
|
||||
*Jon Moss*
|
||||
|
||||
* New section in Configuring: Configuring Active Job.
|
||||
|
||||
*Eliot Sykes*
|
||||
|
||||
* New section in Active Record Association Basics: Single Table Inheritance.
|
||||
|
||||
*Andrey Nering*
|
||||
|
||||
* New section in Active Record Querying: Understanding The Method Chaining.
|
||||
|
||||
*Andrey Nering*
|
||||
|
||||
* New section in Configuring: Search Engines Indexing.
|
||||
|
||||
*Andrey Nering*
|
||||
|
||||
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/guides/CHANGELOG.md) for previous changes.
|
||||
Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/guides/CHANGELOG.md) for previous changes.
|
||||
|
|
|
@ -1,529 +1,2 @@
|
|||
## Rails 5.0.0.rc1 (May 06, 2016) ##
|
||||
|
||||
* No changes.
|
||||
|
||||
|
||||
## Rails 5.0.0.beta4 (April 27, 2016) ##
|
||||
|
||||
* Add `config/initializers/to_time_preserves_timezone.rb`, which tells
|
||||
Active Support to preserve the receiver's timezone when calling `to_time`.
|
||||
This matches the new behavior that will be part of Ruby 2.4.
|
||||
|
||||
Fixes #24617.
|
||||
|
||||
*Andrew White*
|
||||
|
||||
* Make `rails restart` command work with Puma by passing the restart command
|
||||
which Puma can use to restart rails server.
|
||||
|
||||
*Prathamesh Sonpatki*
|
||||
|
||||
* The application generator writes a new file `config/spring.rb`, which tells
|
||||
Spring to watch additional common files.
|
||||
|
||||
*Xavier Noria*
|
||||
|
||||
* The tasks in the rails task namespace is deprecated in favor of app namespace.
|
||||
(e.g. `rails:update` and `rails:template` tasks is renamed to `app:update` and `app:template`.)
|
||||
|
||||
*Ryo Hashimoto*
|
||||
|
||||
* Enable HSTS with IncludeSudomains header for new applications.
|
||||
|
||||
*Egor Homakov*, *Prathamesh Sonpatki*
|
||||
|
||||
## Rails 5.0.0.beta3 (February 24, 2016) ##
|
||||
|
||||
* Alias `rake` with `rails_command` in the Rails Application Templates API
|
||||
following Rails 5 convention of preferring "rails" to "rake" to run tasks.
|
||||
|
||||
*claudiob*
|
||||
|
||||
* Generate applications with an option to log to STDOUT in production
|
||||
using the environment variable `RAILS_LOG_TO_STDOUT`.
|
||||
|
||||
*Richard Schneeman*
|
||||
|
||||
* Change fail fast of `bin/rails test` interrupts run on error.
|
||||
|
||||
*Yuji Yaginuma*
|
||||
|
||||
* The application generator supports `--skip-listen` to opt-out of features
|
||||
that depend on the listen gem. As of this writing they are the evented file
|
||||
system monitor and the async plugin for spring.
|
||||
|
||||
* The Gemfiles of new applications include spring-watcher-listen on Linux and
|
||||
Mac OS X (unless `--skip-spring`).
|
||||
|
||||
*Xavier Noria*
|
||||
|
||||
* New applications are generated with the evented file system monitor enabled
|
||||
on Linux and Mac OS X.
|
||||
|
||||
*Xavier Noria*
|
||||
|
||||
* Add dummy files for apple-touch-icon.png and apple-touch-icon.png.
|
||||
|
||||
See #23427.
|
||||
|
||||
*Alexey Zabelin*
|
||||
|
||||
## Rails 5.0.0.beta2 (February 01, 2016) ##
|
||||
|
||||
* Add `after_bundle` callbacks in Rails plugin templates. Useful for allowing
|
||||
templates to perform actions that are dependent upon `bundle install`.
|
||||
|
||||
*Ryan Manuel*
|
||||
|
||||
* Bring back `TEST=` env for `rake test` task.
|
||||
|
||||
*Yves Senn*
|
||||
|
||||
* Specify log file names or all logs to clear `rake log:clear`
|
||||
|
||||
Specify which logs to clear when using the `rake log:clear` task, e.g. `rake log:clear LOGS=test,staging`
|
||||
|
||||
Clear all logs from log/*.log e.g. `rake log:clear LOGS=all`
|
||||
|
||||
By default `rake log:clear` clears standard environment log files i.e. 'development,test,production'
|
||||
|
||||
*Pramod Shinde*
|
||||
|
||||
* Fix using `add_source` with a block after using `gem` in a custom generator.
|
||||
|
||||
*Will Fisher*
|
||||
|
||||
|
||||
## Rails 5.0.0.beta1 (December 18, 2015) ##
|
||||
|
||||
* Newly generated plugins get a `README.md` in Markdown.
|
||||
|
||||
*Yuji Yaginuma*
|
||||
|
||||
* The generated config file for the development environment includes a new
|
||||
config line, commented out, showing how to enable the evented file watcher.
|
||||
|
||||
*Xavier Noria*
|
||||
|
||||
* `config.debug_exception_response_format` configures the format used
|
||||
in responses when errors occur in development mode.
|
||||
|
||||
Set `config.debug_exception_response_format` to render an HTML page with
|
||||
debug info (using the value `:default`) or render debug info preserving
|
||||
the response format (using the value `:api`).
|
||||
|
||||
*Jorge Bejar*
|
||||
|
||||
* Fix setting exit status code for rake test tasks. The exit status code
|
||||
was not set when tests were fired with `rake`. Now, it is being set and it matches
|
||||
behavior of running tests via `rails` command (`rails test`), so no matter if
|
||||
`rake test` or `rails test` command is used the exit code will be set.
|
||||
|
||||
*Arkadiusz Fal*
|
||||
|
||||
* Add Command infrastructure to replace rake.
|
||||
|
||||
Also move `rake dev:cache` to new infrastructure. You'll need to use
|
||||
`rails dev:cache` to toggle development caching from now on.
|
||||
|
||||
*Chuck Callebs*
|
||||
|
||||
* Allow use of `minitest-rails` gem with Rails test runner.
|
||||
|
||||
Fixes #22455.
|
||||
|
||||
*Chris Kottom*
|
||||
|
||||
* Add `bin/test` script to rails plugin.
|
||||
|
||||
`bin/test` can use the same API as `bin/rails test`.
|
||||
|
||||
*Yuji Yaginuma*
|
||||
|
||||
* Make `static_index` part of the `config.public_file_server` config and
|
||||
call it `config.public_file_server.index_name`.
|
||||
|
||||
*Yuki Nishijima*
|
||||
|
||||
* Deprecate `config.serve_static_files` in favor of `config.public_file_server.enabled`.
|
||||
|
||||
Unifies the static asset options under `config.public_file_server`.
|
||||
|
||||
To upgrade, replace occurrences of:
|
||||
|
||||
```
|
||||
config.serve_static_files = # false or true
|
||||
```
|
||||
|
||||
in your environment files, with:
|
||||
|
||||
```
|
||||
config.public_file_server.enabled = # false or true
|
||||
```
|
||||
|
||||
*Kasper Timm Hansen*
|
||||
|
||||
* Deprecate `config.static_cache_control` in favor of
|
||||
`config.public_file_server.headers`.
|
||||
|
||||
To upgrade, replace occurrences of:
|
||||
|
||||
```
|
||||
config.static_cache_control = 'public, max-age=60'
|
||||
```
|
||||
|
||||
in your environment files, with:
|
||||
|
||||
```
|
||||
config.public_file_server.headers = {
|
||||
'Cache-Control' => 'public, max-age=60'
|
||||
}
|
||||
```
|
||||
|
||||
`config.public_file_server.headers` can set arbitrary headers, sent along when
|
||||
a response is delivered.
|
||||
|
||||
*Yuki Nishijima*
|
||||
|
||||
* Route generators are now idempotent.
|
||||
Running generators several times no longer require you to cleanup routes.rb.
|
||||
|
||||
*Thiago Pinto*
|
||||
|
||||
* Allow passing an environment to `config_for`.
|
||||
|
||||
*Simon Eskildsen*
|
||||
|
||||
* Allow `rake stats` to account for rake tasks in lib/tasks.
|
||||
|
||||
*Kevin Deisz*
|
||||
|
||||
* Added javascript to update the URL on mailer previews with the currently
|
||||
selected email format. Reloading the page now keeps you on your selected
|
||||
format rather than going back to the default html version.
|
||||
|
||||
*James Kerr*
|
||||
|
||||
* Add fail fast to `bin/rails test`.
|
||||
|
||||
Adding `--fail-fast` or `-f` when running tests will interrupt the run on
|
||||
the first failure:
|
||||
|
||||
```
|
||||
# Running:
|
||||
|
||||
................................................S......E
|
||||
|
||||
ArgumentError: Wups! Bet you didn't expect this!
|
||||
test/models/bunny_test.rb:19:in `block in <class:BunnyTest>'
|
||||
|
||||
bin/rails test test/models/bunny_test.rb:18
|
||||
|
||||
....................................F
|
||||
|
||||
This failed
|
||||
|
||||
bin/rails test test/models/bunny_test.rb:14
|
||||
|
||||
Interrupted. Exiting...
|
||||
|
||||
|
||||
Finished in 0.051427s, 1808.3872 runs/s, 1769.4972 assertions/s.
|
||||
|
||||
```
|
||||
|
||||
Note that any unexpected errors don't abort the run.
|
||||
|
||||
*Kasper Timm Hansen*
|
||||
|
||||
* Add inline output to `bin/rails test`.
|
||||
|
||||
Any failures or errors (and skips if running in verbose mode) are output
|
||||
during a test run:
|
||||
|
||||
```
|
||||
# Running:
|
||||
|
||||
.....S..........................................F
|
||||
|
||||
This failed
|
||||
|
||||
bin/rails test test/models/bunny_test.rb:14
|
||||
|
||||
.................................E
|
||||
|
||||
ArgumentError: Wups! Bet you didn't expect this!
|
||||
test/models/bunny_test.rb:19:in `block in <class:BunnyTest>'
|
||||
|
||||
bin/rails test test/models/bunny_test.rb:18
|
||||
|
||||
....................
|
||||
|
||||
Finished in 0.069708s, 1477.6019 runs/s, 1448.9106 assertions/s.
|
||||
```
|
||||
|
||||
Output can be deferred to after a run with the `--defer-output` option.
|
||||
|
||||
*Kasper Timm Hansen*
|
||||
|
||||
* Fix displaying mailer previews on non local requests when config
|
||||
`config.action_mailer.show_previews` is set.
|
||||
|
||||
*Wojciech Wnętrzak*
|
||||
|
||||
* `rails server` will now honour the `PORT` environment variable
|
||||
|
||||
*David Cornu*
|
||||
|
||||
* Plugins generated using `rails plugin new` are now generated with the
|
||||
version number set to 0.1.0.
|
||||
|
||||
*Daniel Morris*
|
||||
|
||||
* `I18n.load_path` is now reloaded under development so there's no need to
|
||||
restart the server to make new locale files available. Also, I18n will no
|
||||
longer raise for deleted locale files.
|
||||
|
||||
*Kir Shatrov*
|
||||
|
||||
* Add `bin/update` script to update development environment automatically.
|
||||
|
||||
*Mehmet Emin İNAÇ*
|
||||
|
||||
* Fix STATS_DIRECTORIES already defined warning when running rake from within
|
||||
the top level directory of an engine that has a test app.
|
||||
|
||||
Fixes #20510.
|
||||
|
||||
*Ersin Akinci*
|
||||
|
||||
* Make enabling or disabling caching in development mode possible with
|
||||
`rake dev:cache`.
|
||||
|
||||
Running `rake dev:cache` will create or remove tmp/caching-dev.txt. When this
|
||||
file exists `config.action_controller.perform_caching` will be set to true in
|
||||
config/environments/development.rb.
|
||||
|
||||
Additionally, a server can be started with either `--dev-caching` or
|
||||
`--no-dev-caching` included to toggle caching on startup.
|
||||
|
||||
*Jussi Mertanen*, *Chuck Callebs*
|
||||
|
||||
* Add a `--api` option in order to generate plugins that can be added
|
||||
inside an API application.
|
||||
|
||||
*Robin Dupret*
|
||||
|
||||
* Fix `NoMethodError` when generating a scaffold inside a full engine.
|
||||
|
||||
*Yuji Yaginuma*
|
||||
|
||||
* Adding support for passing a block to the `add_source` action of a custom generator.
|
||||
|
||||
*Mike Dalton*, *Hirofumi Wakasugi*
|
||||
|
||||
* `assert_file` now understands paths with special characters
|
||||
(eg. `v0.1.4~alpha+nightly`).
|
||||
|
||||
*Diego Carrion*
|
||||
|
||||
* Remove ContentLength middleware from the defaults. If you want it, just
|
||||
add it as a middleware in your config.
|
||||
|
||||
*Egg McMuffin*
|
||||
|
||||
* Make it possible to customize the executable inside rerun snippets.
|
||||
|
||||
*Yves Senn*
|
||||
|
||||
* Add support for API only apps.
|
||||
Middleware stack was slimmed down and it has only the needed
|
||||
middleware for API apps & generators generates the right files,
|
||||
folders and configurations.
|
||||
|
||||
*Santiago Pastorino*, *Jorge Bejar*
|
||||
|
||||
* Make generated scaffold functional tests work inside engines.
|
||||
|
||||
*Yuji Yaginuma*
|
||||
|
||||
* Generate a `.keep` file in the `tmp` folder by default as many scripts
|
||||
assume the existence of this folder and most would fail if it is absent.
|
||||
|
||||
See #20299.
|
||||
|
||||
*Yoong Kang Lim*, *Sunny Juneja*
|
||||
|
||||
* `config.static_index` configures directory `index.html` filename
|
||||
|
||||
Set `config.static_index` to serve a static directory index file not named
|
||||
`index`. E.g. to serve `main.html` instead of `index.html` for directory
|
||||
requests, set `config.static_index` to `"main"`.
|
||||
|
||||
*Eliot Sykes*
|
||||
|
||||
* `bin/setup` uses built-in rake tasks (`log:clear`, `tmp:clear`).
|
||||
|
||||
*Mohnish Thallavajhula*
|
||||
|
||||
* Fix mailer previews with attachments by using the mail gem's own API to
|
||||
locate the first part of the correct mime type.
|
||||
|
||||
Fixes #14435.
|
||||
|
||||
*Andrew White*
|
||||
|
||||
* Remove sqlite support from `rails dbconsole`.
|
||||
|
||||
*Andrew White*
|
||||
|
||||
* Rename `railties/bin` to `railties/exe` to match the new Bundler executables
|
||||
convention.
|
||||
|
||||
*Islam Wazery*
|
||||
|
||||
* Print `bundle install` output in `rails new` as soon as it's available.
|
||||
|
||||
Running `rails new` will now print the output of `bundle install` as
|
||||
it is available, instead of waiting until all gems finish installing.
|
||||
|
||||
*Max Holder*
|
||||
|
||||
* Respect `pluralize_table_names` when generating fixture file.
|
||||
|
||||
Fixes #19519.
|
||||
|
||||
*Yuji Yaginuma*
|
||||
|
||||
* Add a new-line to the end of route method generated code.
|
||||
|
||||
We need to add a `\n`, because we cannot have two routes
|
||||
in the same line.
|
||||
|
||||
*arthurnn*
|
||||
|
||||
* Add `rake initializers`.
|
||||
|
||||
This task prints out all defined initializers in the order they are invoked
|
||||
by Rails. This is helpful for debugging issues related to the initialization
|
||||
process.
|
||||
|
||||
*Naoto Kaneko*
|
||||
|
||||
* Created rake restart task. Restarts your Rails app by touching the
|
||||
`tmp/restart.txt`.
|
||||
|
||||
See #18876.
|
||||
|
||||
*Hyonjee Joo*
|
||||
|
||||
* Add `config/initializers/active_record_belongs_to_required_by_default.rb`.
|
||||
|
||||
Newly generated Rails apps have a new initializer called
|
||||
`active_record_belongs_to_required_by_default.rb` which sets the value of
|
||||
the configuration option `config.active_record.belongs_to_required_by_default`
|
||||
to `true` when ActiveRecord is not skipped.
|
||||
|
||||
As a result, new Rails apps require `belongs_to` association on model
|
||||
to be valid.
|
||||
|
||||
This initializer is *not* added when running `rake rails:update`, so
|
||||
old apps ported to Rails 5 will work without any change.
|
||||
|
||||
*Josef Šimánek*
|
||||
|
||||
* `delete` operations in configurations are run last in order to eliminate
|
||||
'No such middleware' errors when `insert_before` or `insert_after` are added
|
||||
after the `delete` operation for the middleware being deleted.
|
||||
|
||||
Fixes #16433.
|
||||
|
||||
*Guo Xiang Tan*
|
||||
|
||||
* Newly generated applications get a `README.md` in Markdown.
|
||||
|
||||
*Xavier Noria*
|
||||
|
||||
* Remove the documentation tasks `doc:app`, `doc:rails`, and `doc:guides`.
|
||||
|
||||
*Xavier Noria*
|
||||
|
||||
* Force generated routes to be inserted into `config/routes.rb`.
|
||||
|
||||
*Andrew White*
|
||||
|
||||
* Don't remove all line endings from `config/routes.rb` when revoking scaffold.
|
||||
|
||||
Fixes #15913.
|
||||
|
||||
*Andrew White*
|
||||
|
||||
* Rename `--skip-test-unit` option to `--skip-test` in app generator
|
||||
|
||||
*Melanie Gilman*
|
||||
|
||||
* Add the `method_source` gem to the default Gemfile for apps.
|
||||
|
||||
*Sean Griffin*
|
||||
|
||||
* Drop old test locations from `rake stats`:
|
||||
|
||||
- test/functional
|
||||
- test/unit
|
||||
|
||||
*Ravil Bayramgalin*
|
||||
|
||||
* Update `rake stats` to correctly count declarative tests
|
||||
as methods in `_test.rb` files.
|
||||
|
||||
*Ravil Bayramgalin*
|
||||
|
||||
* Remove deprecated `test:all` and `test:all:db` tasks.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `Rails::Rack::LogTailer`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `RAILS_CACHE` constant.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `serve_static_assets` configuration.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Use local variables in `_form.html.erb` partial generated by scaffold.
|
||||
|
||||
*Andrew Kozlov*
|
||||
|
||||
* Add `config/initializers/callback_terminator.rb`.
|
||||
|
||||
Newly generated Rails apps have a new initializer called
|
||||
`callback_terminator.rb` which sets the value of the configuration option
|
||||
`ActiveSupport.halt_callback_chains_on_return_false` to `false`.
|
||||
|
||||
As a result, new Rails apps do not halt Active Record and Active Model
|
||||
callback chains when a callback returns `false`; only when they are
|
||||
explicitly halted with `throw(:abort)`.
|
||||
|
||||
The terminator is *not* added when running `rake rails:update`, so returning
|
||||
`false` will still work on old apps ported to Rails 5, displaying a
|
||||
deprecation warning to prompt users to update their code to the new syntax.
|
||||
|
||||
*claudiob*
|
||||
|
||||
* Generated fixtures won't use the id when generated with references attributes.
|
||||
|
||||
*Pablo Olmos de Aguilera Corradini*
|
||||
|
||||
* Add `--skip-action-mailer` option to the app generator.
|
||||
|
||||
*claudiob*
|
||||
|
||||
* Autoload any second level directories called `app/*/concerns`.
|
||||
|
||||
*Alex Robbin*
|
||||
|
||||
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/railties/CHANGELOG.md) for previous changes.
|
||||
Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/railties/CHANGELOG.md) for previous changes.
|
||||
|
|
|
@ -6,9 +6,9 @@ module Rails
|
|||
|
||||
module VERSION
|
||||
MAJOR = 5
|
||||
MINOR = 0
|
||||
MINOR = 1
|
||||
TINY = 0
|
||||
PRE = "rc1"
|
||||
PRE = "alpha"
|
||||
|
||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||
end
|
||||
|
|
|
@ -6,9 +6,9 @@ module Rails
|
|||
|
||||
module VERSION
|
||||
MAJOR = 5
|
||||
MINOR = 0
|
||||
MINOR = 1
|
||||
TINY = 0
|
||||
PRE = "rc1"
|
||||
PRE = "alpha"
|
||||
|
||||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue