diff --git a/Gemfile b/Gemfile index 64e467604b9..477309fa9b6 100644 --- a/Gemfile +++ b/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 diff --git a/Gemfile.lock b/Gemfile.lock index 2e3b0349a69..504364e5522 100644 --- a/Gemfile.lock +++ b/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! diff --git a/RAILS_VERSION b/RAILS_VERSION index f73ebf1c37a..8ea10160818 100644 --- a/RAILS_VERSION +++ b/RAILS_VERSION @@ -1 +1 @@ -5.0.0.rc1 +5.1.0.alpha diff --git a/actioncable/CHANGELOG.md b/actioncable/CHANGELOG.md index 375fe88b2fc..a767857607e 100644 --- a/actioncable/CHANGELOG.md +++ b/actioncable/CHANGELOG.md @@ -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. diff --git a/actioncable/lib/action_cable/gem_version.rb b/actioncable/lib/action_cable/gem_version.rb index a0c0b7969e9..8ba0230d478 100644 --- a/actioncable/lib/action_cable/gem_version.rb +++ b/actioncable/lib/action_cable/gem_version.rb @@ -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 diff --git a/actionmailer/CHANGELOG.md b/actionmailer/CHANGELOG.md index e916305e54a..d45e74133a3 100644 --- a/actionmailer/CHANGELOG.md +++ b/actionmailer/CHANGELOG.md @@ -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. diff --git a/actionmailer/lib/action_mailer/gem_version.rb b/actionmailer/lib/action_mailer/gem_version.rb index 759b932c58d..7dafceef2bf 100644 --- a/actionmailer/lib/action_mailer/gem_version.rb +++ b/actionmailer/lib/action_mailer/gem_version.rb @@ -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 diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index f753c44029f..be911b147cd 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -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. diff --git a/actionpack/lib/action_pack/gem_version.rb b/actionpack/lib/action_pack/gem_version.rb index bbb637166ed..d8f86630b1c 100644 --- a/actionpack/lib/action_pack/gem_version.rb +++ b/actionpack/lib/action_pack/gem_version.rb @@ -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 diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md index 7e271a693a4..1d7ec77e70d 100644 --- a/actionview/CHANGELOG.md +++ b/actionview/CHANGELOG.md @@ -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 - - - - ``` - - *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 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. diff --git a/actionview/lib/action_view/gem_version.rb b/actionview/lib/action_view/gem_version.rb index 36eb33fbd9e..5fc4f3f1b93 100644 --- a/actionview/lib/action_view/gem_version.rb +++ b/actionview/lib/action_view/gem_version.rb @@ -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 diff --git a/activejob/CHANGELOG.md b/activejob/CHANGELOG.md index 93b913bf155..5e72c67aea1 100644 --- a/activejob/CHANGELOG.md +++ b/activejob/CHANGELOG.md @@ -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. diff --git a/activejob/Rakefile b/activejob/Rakefile index 2a853b4b6b2..f32c4d2fb2c 100644 --- a/activejob/Rakefile +++ b/activejob/Rakefile @@ -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 diff --git a/activejob/lib/active_job/gem_version.rb b/activejob/lib/active_job/gem_version.rb index a18a5ed1b49..0d50c279383 100644 --- a/activejob/lib/active_job/gem_version.rb +++ b/activejob/lib/active_job/gem_version.rb @@ -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 diff --git a/activemodel/CHANGELOG.md b/activemodel/CHANGELOG.md index a1220ba4c5f..206699c0363 100644 --- a/activemodel/CHANGELOG.md +++ b/activemodel/CHANGELOG.md @@ -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. diff --git a/activemodel/lib/active_model/gem_version.rb b/activemodel/lib/active_model/gem_version.rb index d1a9a3bec91..4a8ee915cf1 100644 --- a/activemodel/lib/active_model/gem_version.rb +++ b/activemodel/lib/active_model/gem_version.rb @@ -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 diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index e954bd2fb7f..0c14c0ea86b 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,2115 +1,2 @@ -## Rails 5.0.0.rc1 (May 06, 2016) ## -* No changes. - - -## Rails 5.0.0.beta4 (April 27, 2016) ## - -* PostgreSQL: Support Expression Indexes and Operator Classes. - - Example: - - create_table :users do |t| - t.string :name - t.index 'lower(name) varchar_pattern_ops' - end - - Fixes #19090, #21765, #21819, #24359. - - *Ryuta Kamizono* - -* MySQL: Prepared statements support. - - To enable, set `prepared_statements: true` in config/database.yml. - Requires mysql2 0.4.4+. - - *Ryuta Kamizono* - -* Schema dumper: Indexes are now included in the `create_table` block - instead of listed afterward as separate `add_index` lines. - - This tidies up schema.rb and makes it easy to read as a list of tables. - - Bonus: Allows databases that support it (MySQL) to perform as single - `CREATE TABLE` query, no additional query per index. - - *Ryuta Kamizono* - -* SQLite: Fix uniqueness validation when values exceed the column limit. - - SQLite doesn't impose length restrictions on strings, BLOBs, or numeric - values. It treats them as helpful metadata. When we truncate strings - before checking uniqueness, we'd miss values that exceed the column limit. - - Other databases enforce length limits. A large value will pass uniqueness - validation since the column limit guarantees no value that long exists. - When we insert the row, it'll raise `ActiveRecord::ValueTooLong` as we - expect. - - This fixes edge-case incorrect validation failures for values that exceed - the column limit but are identical to an existing value *when truncated*. - Now these will pass validation and raise an exception. - - *Ryuta Kamizono* - -* Raise `ActiveRecord::ValueTooLong` when column limits are exceeded. - Supported by MySQL and PostgreSQL adapters. - - *Ryuta Kamizono* - -* Migrations: `#foreign_key` respects `table_name_prefix` and `_suffix`. - - *Ryuta Kamizono* - -* SQLite: Force NOT NULL primary keys. - - From SQLite docs: https://www.sqlite.org/lang_createtable.html - According to the SQL standard, PRIMARY KEY should always imply NOT - NULL. Unfortunately, due to a bug in some early versions, this is not - the case in SQLite. Unless the column is an INTEGER PRIMARY KEY or the - table is a WITHOUT ROWID table or the column is declared NOT NULL, - SQLite allows NULL values in a PRIMARY KEY column. SQLite could be - fixed to conform to the standard, but doing so might break legacy - applications. Hence, it has been decided to merely document the fact - that SQLite allowing NULLs in most PRIMARY KEY columns. - - Now we override column options to explicitly set NOT NULL rather than rely - on implicit NOT NULL like MySQL and PostgreSQL adapters. - - *Ryuta Kamizono* - -* Added notice when a database is successfully created or dropped. - - Example: - - $ bin/rails db:create - Created database 'blog_development' - Created database 'blog_test' - - $ bin/rails db:drop - Dropped database 'blog_development' - Dropped database 'blog_test' - - Changed older notices - `blog_development already exists` to `Database 'blog_development' already exists`. - and - `Couldn't drop blog_development` to `Couldn't drop database 'blog_development'`. - - *bogdanvlviv* - -* Database comments. Annotate database objects (tables, columns, indexes) - with comments stored in database metadata. PostgreSQL & MySQL support. - - create_table :pages, force: :cascade, comment: 'CMS content pages' do |t| - t.string :path, comment: 'Path fragment of page URL used for routing' - t.string :locale, comment: 'RFC 3066 locale code of website language section' - t.index [:path, :locale], comment: 'Look up pages by URI' - end - - *Andrey Novikov* - -* Add `quoted_time` for truncating the date part of a TIME column value. - This fixes queries on TIME column on MariaDB, as it doesn't ignore the - date part of the string when it coerces to time. - - *Ryuta Kamizono* - -* Properly accept all valid JSON primitives in the JSON data type. - - Fixes #24234 - - *Sean Griffin* - -* MariaDB 5.3+ supports microsecond datetime precision. - - *Jeremy Daer* - -* Delegate `none?` and `one?`. Now they can be invoked as model class methods. - - Example: - - # When no record is found on the table - Topic.none? # => true - - # When only one record is found on the table - Topic.one? # => true - - *Kenta Shirai* - -* The form builder now properly displays values when passing a proc form - default to the attributes API. - - Fixes #24249. - - *Sean Griffin* - -* The schema cache is now cleared after the `db:migrate` task is run. - - Closes #24273. - - *Chris Arcand* - -* MySQL: strict mode respects other SQL modes rather than overwriting them. - Setting `strict: true` adds `STRICT_ALL_TABLES` to `sql_mode`. Setting - `strict: false` removes `STRICT_TRANS_TABLES`, `STRICT_ALL_TABLES`, and - `TRADITIONAL` from `sql_mode`. - - *Ryuta Kamizono* - -* Execute default_scope defined by abstract class in the context of subclass. - - Fixes #23413. - Fixes #10658. - - *Mehmet Emin İNAÇ* - -* Fix an issue when preloading associations with extensions. - Previously every association with extension methods was transformed into an - instance dependent scope. This is no longer the case. - - Fixes #23934. - - *Yves Senn* - -* Deprecate `{insert|update|delete}_sql` in `DatabaseStatements`. - Use the `{insert|update|delete}` public methods instead. - - *Ryuta Kamizono* - -* Added a configuration option to have active record raise an ArgumentError - if the order or limit is ignored in a batch query, rather than logging a - warning message. - - *Scott Ringwelski* - -* Honour the order of the joining model in a `has_many :through` association when eager loading. - - Example: - - The below will now follow the order of `by_lines` when eager loading `authors`. - - class Article < ActiveRecord::Base - has_many :by_lines, -> { order(:position) } - has_many :authors, through: :by_lines - end - - Fixes #17864. - - *Yasyf Mohamedali*, *Joel Turkel* - -* Ensure that the Suppressor runs before validations. - - This moves the suppressor up to be run before validations rather than after - validations. There's no reason to validate a record you aren't planning on saving. - - *Eileen M. Uchitelle* - -## Rails 5.0.0.beta3 (February 24, 2016) ## - -* Save many-to-many objects based on association primary key. - - Fixes #20995. - - *himesh-r* - -* Ensure that mutations of the array returned from `ActiveRecord::Relation#to_a` - do not affect the original relation, by returning a duplicate array each time. - - This brings the behavior in line with `CollectionProxy#to_a`, which was - already more careful. - - *Matthew Draper* - -* Fixed `where` for polymorphic associations when passed an array containing different types. - - Fixes #17011. - - Example: - - PriceEstimate.where(estimate_of: [Treasure.find(1), Car.find(2)]) - # => SELECT "price_estimates".* FROM "price_estimates" - WHERE (("price_estimates"."estimate_of_type" = 'Treasure' AND "price_estimates"."estimate_of_id" = 1) - OR ("price_estimates"."estimate_of_type" = 'Car' AND "price_estimates"."estimate_of_id" = 2)) - - *Philippe Huibonhoa* - -* Fix a bug where using `t.foreign_key` twice with the same `to_table` within - the same table definition would only create one foreign key. - - *George Millo* - -* Fix a regression on has many association, where calling a child from parent in child's callback - results in same child records getting added repeatedly to target. - - Fixes #13387. - - *Bogdan Gusiev*, *Jon Hinson* - -* Rework `ActiveRecord::Relation#last`. - - 1. Never perform additional SQL on loaded relation - 2. Use SQL reverse order instead of loading relation if relation doesn't have limit - 3. Deprecated relation loading when SQL order can not be automatically reversed - - Topic.order("title").load.last(3) - # before: SELECT ... - # after: No SQL - - Topic.order("title").last - # before: SELECT * FROM `topics` - # after: SELECT * FROM `topics` ORDER BY `topics`.`title` DESC LIMIT 1 - - Topic.order("coalesce(author, title)").last - # before: SELECT * FROM `topics` - # after: Deprecation Warning for irreversible order - - *Bogdan Gusiev* - -* Allow `joins` to be unscoped. - - Fixes #13775. - - *Takashi Kokubun* - -* Add ActiveRecord `#second_to_last` and `#third_to_last` methods. - - *Brian Christian* - -* Added `numeric` helper into migrations. - - Example: - - create_table(:numeric_types) do |t| - t.numeric :numeric_type, precision: 10, scale: 2 - end - - *Mehmet Emin İNAÇ* - -* Bumped the minimum supported version of PostgreSQL to >= 9.1. - Both PG 9.0 and 8.4 are past their end of life date: - http://www.postgresql.org/support/versioning/ - - *Remo Mueller* - -## Rails 5.0.0.beta2 (February 01, 2016) ## - -* `ActiveRecord::Relation#reverse_order` throws `ActiveRecord::IrreversibleOrderError` - when the order can not be reversed using current trivial algorithm. - Also raises the same error when `#reverse_order` is called on - relation without any order and table has no primary key: - - Topic.order("concat(author_name, title)").reverse_order - # Before: SELECT `topics`.* FROM `topics` ORDER BY concat(author_name DESC, title) DESC - # After: raises ActiveRecord::IrreversibleOrderError - Edge.all.reverse_order - # Before: SELECT `edges`.* FROM `edges` ORDER BY `edges`.`` DESC - # After: raises ActiveRecord::IrreversibleOrderError - - *Bogdan Gusiev* - -* Improve schema_migrations insertion performance by inserting all versions - in one INSERT SQL. - - *Akira Matsuda*, *Naoto Koshikawa* - -* Using `references` or `belongs_to` in migrations will always add index - for the referenced column by default, without adding `index: true` option - to generated migration file. Users can opt out of this by passing - `index: false`. - - Fixes #18146. - - *Matthew Draper*, *Prathamesh Sonpatki* - -* Run `type` attributes through attributes API type-casting before - instantiating the corresponding subclass. This makes it possible to define - custom STI mappings. - - Fixes #21986. - - *Yves Senn* - -* Don't try to quote functions or expressions passed to `:default` option if - they are passed as procs. - - This will generate proper query with the passed function or expression for - the default option, instead of trying to quote it in incorrect fashion. - - Example: - - create_table :posts do |t| - t.datetime :published_at, default: -> { 'NOW()' } - end - - *Ryuta Kamizono* - -* Fix regression when loading fixture files with symbol keys. - - Fixes #22584. - - *Yves Senn* - -* Use `version` column as primary key for schema_migrations table because - `schema_migrations` versions are guaranteed to be unique. - - This makes it possible to use `update_attributes` on models that do - not have a primary key. - - *Richard Schneeman* - -* Add short-hand methods for text and blob types in MySQL. - - In Pg and Sqlite3, `:text` and `:binary` have variable unlimited length. - But in MySQL, these have limited length for each types (ref #21591, #21619). - This change adds short-hand methods for each text and blob types. - - Example: - - create_table :foos do |t| - t.tinyblob :tiny_blob - t.mediumblob :medium_blob - t.longblob :long_blob - t.tinytext :tiny_text - t.mediumtext :medium_text - t.longtext :long_text - end - - *Ryuta Kamizono* - -* Take into account UTC offset when assigning string representation of - timestamp with offset specified to attribute of time type. - - *Andrey Novikov* - -* When calling `first` with a `limit` argument, return directly from the - `loaded?` records if available. - - *Ben Woosley* - -* Deprecate sending the `offset` argument to `find_nth`. Please use the - `offset` method on relation instead. - - *Ben Woosley* - -## Rails 5.0.0.beta1 (December 18, 2015) ## - -* Limit record touching to once per transaction. - - If you have a parent/grand-parent relation like: - - Comment belongs_to :message, touch: true - Message belongs_to :project, touch: true - Project belongs_to :account, touch: true - - When the lowest entry(`Comment`) is saved, now, it won't repeat the touch - call multiple times for the parent records. - - Related #18606. - - *arthurnn* - -* Order the result of `find(ids)` to match the passed array, if the relation - has no explicit order defined. - - Fixes #20338. - - *Miguel Grazziotin*, *Matthew Draper* - -* Omit default limit values in dumped schema. It's tidier, and if the defaults - change in the future, we can address that via Migration API Versioning. - - *Jean Boussier* - -* Support passing the schema name as a prefix to table name in - `ConnectionAdapters::SchemaStatements#indexes`. Previously the prefix would - be considered a full part of the index name, and only the schema in the - current search path would be considered. - - *Grey Baker* - -* Ignore index name in `index_exists?` and `remove_index` when not passed a - name to check for. - - *Grey Baker* - -* Extract support for the legacy `mysql` database adapter from core. It will - live on in a separate gem for now, but most users should just use `mysql2`. - - *Abdelkader Boudih* - -* ApplicationRecord is a new superclass for all app models, analogous to app - controllers subclassing ApplicationController instead of - ActionController::Base. This gives apps a single spot to configure app-wide - model behavior. - - Newly generated applications have `app/models/application_record.rb` - present by default. - - *Genadi Samokovarov* - -* Version the API presented to migration classes, so we can change parameter - defaults without breaking existing migrations, or forcing them to be - rewritten through a deprecation cycle. - - New migrations specify the Rails version they were written for: - - class AddStatusToOrders < ActiveRecord::Migration[5.0] - def change - # ... - end - end - - *Matthew Draper*, *Ravil Bayramgalin* - -* Use bind params for `limit` and `offset`. This will generate significantly - fewer prepared statements for common tasks like pagination. To support this - change, passing a string containing a comma to `limit` has been deprecated, - and passing an Arel node to `limit` is no longer supported. - - Fixes #22250. - - *Sean Griffin* - -* Introduce after_{create,update,delete}_commit callbacks. - - Before: - - after_commit :add_to_index_later, on: :create - after_commit :update_in_index_later, on: :update - after_commit :remove_from_index_later, on: :destroy - - After: - - after_create_commit :add_to_index_later - after_update_commit :update_in_index_later - after_destroy_commit :remove_from_index_later - - Fixes #22515. - - *Genadi Samokovarov* - -* Respect the column default values for `inheritance_column` when - instantiating records through the base class. - - Fixes #17121. - - Example: - - # The schema of BaseModel has `t.string :type, default: 'SubType'` - subtype = BaseModel.new - assert_equals SubType, subtype.class - - *Kuldeep Aggarwal* - -* Fix `rake db:structure:dump` on Postgres when multiple schemas are used. - - Fixes #22346. - - *Nick Muerdter*, *ckoenig* - -* Add schema dumping support for PostgreSQL geometric data types. - - *Ryuta Kamizono* - -* Except keys of `build_record`'s argument from `create_scope` in `initialize_attributes`. - - Fixes #21893. - - *Yuichiro Kaneko* - -* Deprecate `connection.tables` on the SQLite3 and MySQL adapters. - Also deprecate passing arguments to `#tables`. - And deprecate `table_exists?`. - - The `#tables` method of some adapters (mysql, mysql2, sqlite3) would return - both tables and views while others (postgresql) just return tables. To make - their behavior consistent, `#tables` will return only tables in the future. - - The `#table_exists?` method would check both tables and views. To make - their behavior consistent with `#tables`, `#table_exists?` will check only - tables in the future. - - *Yuichiro Kaneko* - -* Improve support for non Active Record objects on `validates_associated` - - Skipping `marked_for_destruction?` when the associated object does not responds - to it make easier to validate virtual associations built on top of Active Model - objects and/or serialized objects that implement a `valid?` instance method. - - *Kassio Borges*, *Lucas Mazza* - -* Change connection management middleware to return a new response with - a body proxy, rather than mutating the original. - - *Kevin Buchanan* - -* Make `db:migrate:status` to render `1_some.rb` format migrate files. - - These files are in `db/migrate`: - - * 1_valid_people_have_last_names.rb - * 20150819202140_irreversible_migration.rb - * 20150823202140_add_admin_flag_to_users.rb - * 20150823202141_migration_tests.rb - * 2_we_need_reminders.rb - * 3_innocent_jointable.rb - - Before: - - $ bundle exec rake db:migrate:status - ... - - Status Migration ID Migration Name - -------------------------------------------------- - up 001 ********** NO FILE ********** - up 002 ********** NO FILE ********** - up 003 ********** NO FILE ********** - up 20150819202140 Irreversible migration - up 20150823202140 Add admin flag to users - up 20150823202141 Migration tests - - After: - - $ bundle exec rake db:migrate:status - ... - - Status Migration ID Migration Name - -------------------------------------------------- - up 001 Valid people have last names - up 002 We need reminders - up 003 Innocent jointable - up 20150819202140 Irreversible migration - up 20150823202140 Add admin flag to users - up 20150823202141 Migration tests - - *Yuichiro Kaneko* - -* Define `ActiveRecord::Sanitization.sanitize_sql_for_order` and use it inside - `preprocess_order_args`. - - *Yuichiro Kaneko* - -* Allow bigint with default nil for avoiding auto increment primary key. - - *Ryuta Kamizono* - -* Remove `DEFAULT_CHARSET` and `DEFAULT_COLLATION` in `MySQLDatabaseTasks`. - - We should omit the collation entirely rather than providing a default. - Then the choice is the responsibility of the server and MySQL distribution. - - *Ryuta Kamizono* - -* Alias `ActiveRecord::Relation#left_joins` to - `ActiveRecord::Relation#left_outer_joins`. - - *Takashi Kokubun* - -* Use advisory locking to raise a `ConcurrentMigrationError` instead of - attempting to migrate when another migration is currently running. - - *Sam Davies* - -* Added `ActiveRecord::Relation#left_outer_joins`. - - Example: - - User.left_outer_joins(:posts) - # => SELECT "users".* FROM "users" LEFT OUTER JOIN "posts" ON - "posts"."user_id" = "users"."id" - - *Florian Thomas* - -* Support passing an array to `order` for SQL parameter sanitization. - - *Aaron Suggs* - -* Avoid disabling errors on the PostgreSQL connection when enabling the - `standard_conforming_strings` setting. Errors were previously disabled because - the setting wasn't writable in Postgres 8.1 and didn't exist in earlier - versions. Now Rails only supports Postgres 8.2+ we're fine to assume the - setting exists. Disabling errors caused problems when using a connection - pooling tool like PgBouncer because it's not guaranteed to have the same - connection between calls to `execute` and it could leave the connection - with errors disabled. - - Fixes #22101. - - *Harry Marr* - -* Set `scope.reordering_value` to `true` if `:reordering`-values are specified. - - Fixes #21886. - - *Hiroaki Izu* - -* Add support for bidirectional destroy dependencies. - - Fixes #13609. - - Example: - - class Content < ActiveRecord::Base - has_one :position, dependent: :destroy - end - - class Position < ActiveRecord::Base - belongs_to :content, dependent: :destroy - end - - *Seb Jacobs* - -* Includes HABTM returns correct size now. It's caused by the join dependency - only instantiates one HABTM object because the join table hasn't a primary key. - - Fixes #16032. - - Examples: - - before: - - Project.first.salaried_developers.size # => 3 - Project.includes(:salaried_developers).first.salaried_developers.size # => 1 - - after: - - Project.first.salaried_developers.size # => 3 - Project.includes(:salaried_developers).first.salaried_developers.size # => 3 - - *Bigxiang* - -* Add option to index errors in nested attributes - - For models which have nested attributes, errors within those models will - now be indexed if `:index_errors` is specified when defining a - has_many relationship, or if its set in the global config. - - Example: - - class Guitar < ActiveRecord::Base - has_many :tuning_pegs, index_errors: true - accepts_nested_attributes_for :tuning_pegs - end - - class TuningPeg < ActiveRecord::Base - belongs_to :guitar - validates_numericality_of :pitch - end - - # Old style - guitar.errors["tuning_pegs.pitch"] = ["is not a number"] - - # New style (if defined globally, or set in has_many_relationship) - guitar.errors["tuning_pegs[1].pitch"] = ["is not a number"] - - *Michael Probber*, *Terence Sun* - -* Exit with non-zero status for failed database rake tasks. - - *Jay Hayes* - -* Queries such as `Computer.joins(:monitor).group(:status).count` will now be - interpreted as `Computer.joins(:monitor).group('computers.status').count` - so that when `Computer` and `Monitor` have both `status` columns we don't - have conflicts in projection. - - *Rafael Sales* - -* Add ability to default to `uuid` as primary key when generating database migrations. - - Example: - - config.generators do |g| - g.orm :active_record, primary_key_type: :uuid - end - - *Jon McCartie* - -* Don't cache arguments in `#find_by` if they are an `ActiveRecord::Relation`. - - Fixes #20817. - - *Hiroaki Izu* - -* Qualify column name inserted by `group` in calculation. - - Giving `group` an unqualified column name now works, even if the relation - has `JOIN` with another table which also has a column of the name. - - *Soutaro Matsumoto* - -* Don't cache prepared statements containing an IN clause or a SQL literal, as - these queries will change often and are unlikely to have a cache hit. - - *Sean Griffin* - -* Fix `rewhere` in a `has_many` association. - - Fixes #21955. - - *Josh Branchaud*, *Kal* - -* `where` raises ArgumentError on unsupported types. - - Fixes #20473. - - *Jake Worth* - -* Add an immutable string type to help reduce memory usage for apps which do - not need mutation detection on strings. - - *Sean Griffin* - -* Give `ActiveRecord::Relation#update` its own deprecation warning when - passed an `ActiveRecord::Base` instance. - - Fixes #21945. - - *Ted Johansson* - -* Make it possible to pass `:to_table` when adding a foreign key through - `add_reference`. - - Fixes #21563. - - *Yves Senn* - -* No longer pass deprecated option `-i` to `pg_dump`. - - *Paul Sadauskas* - -* Concurrent `AR::Base#increment!` and `#decrement!` on the same record - are all reflected in the database rather than overwriting each other. - - *Bogdan Gusiev* - -* Avoid leaking the first relation we call `first` on, per model. - - Fixes #21921. - - *Matthew Draper*, *Jean Boussier* - -* Remove unused `pk_and_sequence_for` in `AbstractMysqlAdapter`. - - *Ryuta Kamizono* - -* Allow fixtures files to set the model class in the YAML file itself. - - To load the fixtures file `accounts.yml` as the `User` model, use: - - _fixture: - model_class: User - david: - name: David - - Fixes #9516. - - *Roque Pinel* - -* Don't require a database connection to load a class which uses acceptance - validations. - - *Sean Griffin* - -* Correctly apply `unscope` when preloading through associations. - - *Jimmy Bourassa* - -* Fixed taking precision into count when assigning a value to timestamp attribute. - - Timestamp column can have less precision than ruby timestamp - In result in how big a fraction of a second can be stored in the - database. - - - m = Model.create! - m.created_at.usec == m.reload.created_at.usec # => false - # due to different precision in Time.now and database column - - If the precision is low enough, (mysql default is 0, so it is always low - enough by default) the value changes when model is reloaded from the - database. This patch fixes that issue ensuring that any timestamp - assigned as an attribute is converted to column precision under the - attribute. - - *Bogdan Gusiev* - -* Introduce `connection.data_sources` and `connection.data_source_exists?`. - These methods determine what relations can be used to back Active Record - models (usually tables and views). - - Also deprecate `SchemaCache#tables`, `SchemaCache#table_exists?` and - `SchemaCache#clear_table_cache!` in favor of their new data source - counterparts. - - *Yves Senn*, *Matthew Draper* - -* Add `ActiveRecord::Base.ignored_columns` to make some columns - invisible from Active Record. - - *Jean Boussier* - -* `ActiveRecord::Tasks::MySQLDatabaseTasks` fails if shellout to - mysql commands (like `mysqldump`) is not successful. - - *Steve Mitchell* - -* Ensure `select` quotes aliased attributes, even when using `from`. - - Fixes #21488. - - *Sean Griffin*, *@johanlunds* - -* MySQL: support `unsigned` numeric data types. - - Example: - - create_table :foos do |t| - t.unsigned_integer :quantity - t.unsigned_bigint :total - t.unsigned_float :percentage - t.unsigned_decimal :price, precision: 10, scale: 2 - end - - The `unsigned: true` option may be used for the primary key: - - create_table :foos, id: :bigint, unsigned: true do |t| - … - end - - *Ryuta Kamizono* - -* Add `#views` and `#view_exists?` methods on connection adapters. - - *Ryuta Kamizono* - -* Correctly dump composite primary key. - - Example: - - create_table :barcodes, primary_key: ["region", "code"] do |t| - t.string :region - t.integer :code - end - - *Ryuta Kamizono* - -* Lookup the attribute name for `restrict_with_error` messages on the - model class that defines the association. - - *kuboon*, *Ronak Jangir* - -* Correct query for PostgreSQL 8.2 compatibility. - - *Ben Murphy*, *Matthew Draper* - -* `bin/rails db:migrate` uses - `ActiveRecord::Tasks::DatabaseTasks.migrations_paths` instead of - `Migrator.migrations_paths`. - - *Tobias Bielohlawek* - -* Support dropping indexes concurrently in PostgreSQL. - - See http://www.postgresql.org/docs/9.4/static/sql-dropindex.html for more - details. - - *Grey Baker* - -* Deprecate passing conditions to `ActiveRecord::Relation#delete_all` - and `ActiveRecord::Relation#destroy_all`. - - *Wojciech Wnętrzak* - -* Instantiating an AR model with `ActionController::Parameters` now raises - an `ActiveModel::ForbiddenAttributesError` if the parameters include a - `type` field that has not been explicitly permitted. Previously, the - `type` field was simply ignored in the same situation. - - *Prem Sichanugrist* - -* PostgreSQL, `create_schema`, `drop_schema` and `rename_table` now quote - schema names. - - Fixes #21418. - - Example: - - create_schema("my.schema") - # CREATE SCHEMA "my.schema"; - - *Yves Senn* - -* PostgreSQL, add `:if_exists` option to `#drop_schema`. This makes it - possible to drop a schema that might exist without raising an exception if - it doesn't. - - *Yves Senn* - -* Only try to nullify has_one target association if the record is persisted. - - Fixes #21223. - - *Agis Anastasopoulos* - -* Uniqueness validator raises descriptive error when running on a persisted - record without primary key. - - Fixes #21304. - - *Yves Senn* - -* Add a native JSON data type support in MySQL. - - Example: - - create_table :json_data_type do |t| - t.json :settings - end - - *Ryuta Kamizono* - -* Descriptive error message when fixtures contain a missing column. - - Fixes #21201. - - *Yves Senn* - -* `ActiveRecord::Tasks::PostgreSQLDatabaseTasks` fail if shellout to - postgresql commands (like `pg_dump`) is not successful. - - *Bryan Paxton*, *Nate Berkopec* - -* Add `ActiveRecord::Relation#in_batches` to work with records and relations - in batches. - - Available options are `of` (batch size), `load`, `start`, and `finish`. - - Examples: - - Person.in_batches.each_record(&:party_all_night!) - Person.in_batches.update_all(awesome: true) - Person.in_batches.delete_all - Person.in_batches.each do |relation| - relation.delete_all - sleep 10 # Throttles the delete queries - end - - Fixes #20933. - - *Sina Siadat* - -* Added methods for PostgreSQL geometric data types to use in migrations. - - Example: - - create_table :foo do |t| - t.line :foo_line - t.lseg :foo_lseg - t.box :foo_box - t.path :foo_path - t.polygon :foo_polygon - t.circle :foo_circle - end - - *Mehmet Emin İNAÇ* - -* Add `cache_key` to ActiveRecord::Relation. - - Example: - - @users = User.where("name like ?", "%Alberto%") - @users.cache_key - # => "/users/query-5942b155a43b139f2471b872ac54251f-3-20150714212107656125000" - - *Alberto Fernández-Capel* - -* Properly allow uniqueness validations on primary keys. - - Fixes #20966. - - *Sean Griffin*, *presskey* - -* Don't raise an error if an association failed to destroy when `destroy` was - called on the parent (as opposed to `destroy!`). - - Fixes #20991. - - *Sean Griffin* - -* `ActiveRecord::RecordNotFound` modified to store model name, primary_key and - id of the caller model. It allows the catcher of this exception to make - a better decision to what to do with it. - - Example: - - class SomeAbstractController < ActionController::Base - rescue_from ActiveRecord::RecordNotFound, with: :redirect_to_404 - - private def redirect_to_404(e) - return redirect_to(posts_url) if e.model == 'Post' - raise - end - end - - *Sameer Rahmani* - -* Deprecate the keys for association `restrict_dependent_destroy` errors in favor - of new key names. - - Previously `has_one` and `has_many` associations were using the - `one` and `many` keys respectively. Both of these keys have special - meaning in I18n (they are considered to be pluralizations) so by - renaming them to `has_one` and `has_many` we make the messages more explicit - and most importantly they don't clash with linguistical systems that need to - validate translation keys (and their pluralizations). - - The `:'restrict_dependent_destroy.one'` key should be replaced with - `:'restrict_dependent_destroy.has_one'`, and `:'restrict_dependent_destroy.many'` - with `:'restrict_dependent_destroy.has_many'`. - - *Roque Pinel*, *Christopher Dell* - -* Fix state being carried over from previous transaction. - - Considering the following example where `name` is a required attribute. - Before we had `new_record?` returning `true` for a persisted record: - - author = Author.create! name: 'foo' - author.name = nil - author.save # => false - author.new_record? # => true - - Fixes #20824. - - *Roque Pinel* - -* Correctly ignore `mark_for_destruction` when `autosave` isn't set to `true` - when validating associations. - - Fixes #20882. - - *Sean Griffin* - -* Fix a bug where counter_cache doesn't always work with polymorphic - relations. - - Fixes #16407. - - *Stefan Kanev*, *Sean Griffin* - -* Ensure that cyclic associations with autosave don't cause duplicate errors - to be added to the parent record. - - Fixes #20874. - - *Sean Griffin* - -* Ensure that `ActionController::Parameters` can still be passed to nested - attributes. - - Fixes #20922. - - *Sean Griffin* - -* Deprecate force association reload by passing a truthy argument to - association method. - - For collection association, you can call `#reload` on association proxy to - force a reload: - - @user.posts.reload # Instead of @user.posts(true) - - For singular association, you can call `#reload` on the parent object to - clear its association cache then call the association method: - - @user.reload.profile # Instead of @user.profile(true) - - Passing a truthy argument to force association to reload will be removed in - Rails 5.1. - - *Prem Sichanugrist* - -* Replaced `ActiveSupport::Concurrency::Latch` with `Concurrent::CountDownLatch` - from the concurrent-ruby gem. - - *Jerry D'Antonio* - -* Fix through associations using scopes having the scope merged multiple - times. - - Fixes #20721. - Fixes #20727. - - *Sean Griffin* - -* `ActiveRecord::Base.dump_schema_after_migration` applies migration tasks - other than `db:migrate`. (eg. `db:rollback`, `db:migrate:dup`, ...) - - Fixes #20743. - - *Yves Senn* - -* Add alternate syntax to make `change_column_default` reversible. - - User can pass in `:from` and `:to` to make `change_column_default` command - become reversible. - - Example: - - change_column_default :posts, :status, from: nil, to: "draft" - change_column_default :users, :authorized, from: true, to: false - - *Prem Sichanugrist* - -* Prevent error when using `force_reload: true` on an unassigned polymorphic - belongs_to association. - - Fixes #20426. - - *James Dabbs* - -* Correctly raise `ActiveRecord::AssociationTypeMismatch` when assigning - a wrong type to a namespaced association. - - Fixes #20545. - - *Diego Carrion* - -* `validates_absence_of` respects `marked_for_destruction?`. - - Fixes #20449. - - *Yves Senn* - -* Include the `Enumerable` module in `ActiveRecord::Relation` - - *Sean Griffin*, *bogdan* - -* Use `Enumerable#sum` in `ActiveRecord::Relation` if a block is given. - - *Sean Griffin* - -* Let `WITH` queries (Common Table Expressions) be explainable. - - *Vladimir Kochnev* - -* Make `remove_index :table, :column` reversible. - - *Yves Senn* - -* Fixed an error which would occur in dirty checking when calling - `update_attributes` from a getter. - - Fixes #20531. - - *Sean Griffin* - -* Make `remove_foreign_key` reversible. Any foreign key options must be - specified, similar to `remove_column`. - - *Aster Ryan* - -* Add `:_prefix` and `:_suffix` options to `enum` definition. - - Fixes #17511, #17415. - - *Igor Kapkov* - -* Correctly handle decimal arrays with defaults in the schema dumper. - - Fixes #20515. - - *Sean Griffin*, *jmondo* - -* Deprecate the PostgreSQL `:point` type in favor of a new one which will return - `Point` objects instead of an `Array` - - *Sean Griffin* - -* Ensure symbols passed to `ActiveRecord::Relation#select` are always treated - as columns. - - Fixes #20360. - - *Sean Griffin* - -* Do not set `sql_mode` if `strict: :default` is specified. - - # config/database.yml - production: - adapter: mysql2 - database: foo_prod - user: foo - strict: :default - - *Ryuta Kamizono* - -* Allow proc defaults to be passed to the attributes API. See documentation - for examples. - - *Sean Griffin*, *Kir Shatrov* - -* SQLite: `:collation` support for string and text columns. - - Example: - - create_table :foo do |t| - t.string :string_nocase, collation: 'NOCASE' - t.text :text_rtrim, collation: 'RTRIM' - end - - add_column :foo, :title, :string, collation: 'RTRIM' - - change_column :foo, :title, :string, collation: 'NOCASE' - - *Akshay Vishnoi* - -* Allow the use of symbols or strings to specify enum values in test - fixtures: - - awdr: - title: "Agile Web Development with Rails" - status: :proposed - - *George Claghorn* - -* Clear query cache when `ActiveRecord::Base#reload` is called. - - *Shane Hender, Pierre Nespo* - -* Include stored procedures and function on the MySQL structure dump. - - *Jonathan Worek* - -* Pass `:extend` option for `has_and_belongs_to_many` associations to the - underlying `has_many :through`. - - *Jaehyun Shin* - -* Deprecate `Relation#uniq` use `Relation#distinct` instead. - - See #9683. - - *Yves Senn* - -* Allow single table inheritance instantiation to work when storing - demodulized class names. - - *Alex Robbin* - -* Correctly pass MySQL options when using `structure_dump` or - `structure_load`. - - Specifically, it fixes an issue when using SSL authentication. - - *Alex Coomans* - -* Correctly dump `:options` on `create_table` for MySQL. - - *Ryuta Kamizono* - -* PostgreSQL: `:collation` support for string and text columns. - - Example: - - create_table :foos do |t| - t.string :string_en, collation: 'en_US.UTF-8' - t.text :text_ja, collation: 'ja_JP.UTF-8' - end - - *Ryuta Kamizono* - -* Remove `ActiveRecord::Serialization::XmlSerializer` from core. - - *Zachary Scott* - -* Make `unscope` aware of "less than" and "greater than" conditions. - - *TAKAHASHI Kazuaki* - -* `find_by` and `find_by!` raise `ArgumentError` when called without - arguments. - - *Kohei Suzuki* - -* Revert behavior of `db:schema:load` back to loading the full - environment. This ensures that initializers are run. - - Fixes #19545. - - *Yves Senn* - -* Fix missing index when using `timestamps` with the `index` option. - - The `index` option used with `timestamps` should be passed to both - `column` definitions for `created_at` and `updated_at` rather than just - the first. - - *Paul Mucur* - -* Rename `:class` to `:anonymous_class` in association options. - - Fixes #19659. - - *Andrew White* - -* Autosave existing records on a has many through association when the parent - is new. - - Fixes #19782. - - *Sean Griffin* - -* Fixed a bug where uniqueness validations would error on out of range values, - even if an validation should have prevented it from hitting the database. - - *Andrey Voronkov* - -* MySQL: `:charset` and `:collation` support for string and text columns. - - Example: - - create_table :foos do |t| - t.string :string_utf8_bin, charset: 'utf8', collation: 'utf8_bin' - t.text :text_ascii, charset: 'ascii' - end - - *Ryuta Kamizono* - -* Foreign key related methods in the migration DSL respect - `ActiveRecord::Base.pluralize_table_names = false`. - - Fixes #19643. - - *Mehmet Emin İNAÇ* - -* Reduce memory usage from loading types on PostgreSQL. - - Fixes #19578. - - *Sean Griffin* - -* Add `config.active_record.warn_on_records_fetched_greater_than` option. - - When set to an integer, a warning will be logged whenever a result set - larger than the specified size is returned by a query. - - Fixes #16463. - - *Jason Nochlin* - -* Ignore `.psqlrc` when loading database structure. - - *Jason Weathered* - -* Fix referencing wrong table aliases while joining tables of has many through - association (only when calling calculation methods). - - Fixes #19276. - - *pinglamb* - -* Correctly persist a serialized attribute that has been returned to - its default value by an in-place modification. - - Fixes #19467. - - *Matthew Draper* - -* Fix generating the schema file when using PostgreSQL `BigInt[]` data type. - Previously the `limit: 8` was not coming through, and this caused it to - become `Int[]` data type after rebuilding from the schema. - - Fixes #19420. - - *Jake Waller* - -* Reuse the `CollectionAssociation#reader` cache when the foreign key is - available prior to save. - - *Ben Woosley* - -* Add `config.active_record.dump_schemas` to fix `db:structure:dump` - when using schema_search_path and PostgreSQL extensions. - - Fixes #17157. - - *Ryan Wallace* - -* Renaming `use_transactional_fixtures` to `use_transactional_tests` for clarity. - - Fixes #18864. - - *Brandon Weiss* - -* Increase pg gem version requirement to `~> 0.18`. Earlier versions of the - pg gem are known to have problems with Ruby 2.2. - - *Matt Brictson* - -* Correctly dump `serial` and `bigserial`. - - *Ryuta Kamizono* - -* Fix default `format` value in `ActiveRecord::Tasks::DatabaseTasks#schema_file`. - - *James Cox* - -* Don't enroll records in the transaction if they don't have commit callbacks. - This was causing a memory leak when creating many records inside a transaction. - - Fixes #15549. - - *Will Bryant*, *Aaron Patterson* - -* Correctly create through records when created on a has many through - association when using `where`. - - Fixes #19073. - - *Sean Griffin* - -* Add `SchemaMigration.create_table` support for any unicode charsets with MySQL. - - *Ryuta Kamizono* - -* PostgreSQL no longer disables user triggers if system triggers can't be - disabled. Disabling user triggers does not fulfill what the method promises. - Rails currently requires superuser privileges for this method. - - If you absolutely rely on this behavior, consider patching - `disable_referential_integrity`. - - *Yves Senn* - -* Restore aborted transaction state when `disable_referential_integrity` fails - due to missing permissions. - - *Toby Ovod-Everett*, *Yves Senn* - -* In PostgreSQL, print a warning message if `disable_referential_integrity` - fails due to missing permissions. - - *Andrey Nering*, *Yves Senn* - -* Allow a `:limit` option for MySQL bigint primary key support. - - Example: - - create_table :foos, id: :primary_key, limit: 8 do |t| - end - - # or - - create_table :foos, id: false do |t| - t.primary_key :id, limit: 8 - end - - *Ryuta Kamizono* - -* `belongs_to` will now trigger a validation error by default if the association is not present. - You can turn this off on a per-association basis with `optional: true`. - (Note this new default only applies to new Rails apps that will be generated with - `config.active_record.belongs_to_required_by_default = true` in initializer.) - - *Josef Šimánek* - -* Fixed `ActiveRecord::Relation#becomes!` and `changed_attributes` issues for type - columns. - - Fixes #17139. - - *Miklos Fazekas* - -* Format the time string according to the precision of the time column. - - *Ryuta Kamizono* - -* Allow a `:precision` option for time type columns. - - *Ryuta Kamizono* - -* Add `ActiveRecord::Base.suppress` to prevent the receiver from being saved - during the given block. - - For example, here's a pattern of creating notifications when new comments - are posted. (The notification may in turn trigger an email, a push - notification, or just appear in the UI somewhere): - - class Comment < ActiveRecord::Base - belongs_to :commentable, polymorphic: true - after_create -> { Notification.create! comment: self, - recipients: commentable.recipients } - end - - That's what you want the bulk of the time. A new comment creates a new - Notification. There may be edge cases where you don't want that, like - when copying a commentable and its comments, in which case write a - concern with something like this: - - module Copyable - def copy_to(destination) - Notification.suppress do - # Copy logic that creates new comments that we do not want triggering - # notifications. - end - end - end - - *Michael Ryan* - -* `:time` option added for `#touch`. - - Fixes #18905. - - *Hyonjee Joo* - -* Add `foreign_key_exists?` method. - - *Tõnis Simo* - -* Use SQL COUNT and LIMIT 1 queries for `none?` and `one?` methods - if no block or limit is given, instead of loading the entire - collection into memory. This applies to relations (e.g. `User.all`) - as well as associations (e.g. `account.users`) - - # Before: - - users.none? - # SELECT "users".* FROM "users" - - users.one? - # SELECT "users".* FROM "users" - - # After: - - users.none? - # SELECT 1 AS one FROM "users" LIMIT 1 - - users.one? - # SELECT COUNT(*) FROM "users" - - *Eugene Gilburg* - -* Have `enum` perform type casting consistently with the rest of Active - Record, such as `where`. - - *Sean Griffin* - -* `scoping` no longer pollutes the current scope of sibling classes when using - STI. - - Fixes #18806. - - Example: - - StiOne.none.scoping do - StiTwo.all - end - - - *Sean Griffin* - -* `remove_reference` with `foreign_key: true` removes the foreign key before - removing the column. This fixes a bug where it was not possible to remove - the column on MySQL. - - Fixes #18664. - - *Yves Senn* - -* `find_in_batches` now accepts an `:finish` parameter that complements the `:start` - parameter to specify where to stop batch processing. - - *Vipul A M* - -* Fix a rounding problem for PostgreSQL timestamp columns. - - If a timestamp column has a precision specified, it needs to - format according to that. - - *Ryuta Kamizono* - -* Respect the database default charset for `schema_migrations` table. - - The charset of `version` column in `schema_migrations` table depends - on the database default charset and collation rather than the encoding - of the connection. - - *Ryuta Kamizono* - -* Raise `ArgumentError` when passing `nil` or `false` to `Relation#merge`. - - These are not valid values to merge in a relation, so it should warn users - early. - - *Rafael Mendonça França* - -* Use `SCHEMA` instead of `DB_STRUCTURE` for specifying a structure file. - - This makes the `db:structure` tasks consistent with `test:load_structure`. - - *Dieter Komendera* - -* Respect custom primary keys for associations when calling `Relation#where` - - Fixes #18813. - - *Sean Griffin* - -* Fix several edge cases which could result in a counter cache updating - twice or not updating at all for `has_many` and `has_many :through`. - - Fixes #10865. - - *Sean Griffin* - -* Foreign keys added by migrations were given random, generated names. This - meant a different `structure.sql` would be generated every time a developer - ran migrations on their machine. - - The generated part of foreign key names is now a hash of the table name and - column name, which is consistent every time you run the migration. - - *Chris Sinjakli* - -* Fix n+1 query problem when eager loading nil associations (fixes #18312) - - *Sammy Larbi* - -* Change the default error message from `can't be blank` to `must exist` for - the presence validator of the `:required` option on `belongs_to`/`has_one` - associations. - - *Henrik Nygren* - -* Fixed `ActiveRecord::Relation#group` method when an argument is an SQL - reserved keyword: - - Example: - - SplitTest.group(:key).count - Property.group(:value).count - - *Bogdan Gusiev* - -* Added the `#or` method on `ActiveRecord::Relation`, allowing use of the OR - operator to combine WHERE or HAVING clauses. - - Example: - - Post.where('id = 1').or(Post.where('id = 2')) - # => SELECT * FROM posts WHERE (id = 1) OR (id = 2) - - *Sean Griffin*, *Matthew Draper*, *Gael Muller*, *Olivier El Mekki* - -* Don't define autosave association callbacks twice from - `accepts_nested_attributes_for`. - - Fixes #18704. - - *Sean Griffin* - -* Integer types will no longer raise a `RangeError` when assigning an - attribute, but will instead raise when going to the database. - - Fixes several vague issues which were never reported directly. See the - commit message from the commit which added this line for some examples. - - *Sean Griffin* - -* Values which would error while being sent to the database (such as an - ASCII-8BIT string with invalid UTF-8 bytes on SQLite3), no longer error on - assignment. They will still error when sent to the database, but you are - given the ability to re-assign it to a valid value. - - Fixes #18580. - - *Sean Griffin* - -* Don't remove join dependencies in `Relation#exists?` - - Fixes #18632. - - *Sean Griffin* - -* Invalid values assigned to a JSON column are assumed to be `nil`. - - Fixes #18629. - - *Sean Griffin* - -* Add `ActiveRecord::Base#accessed_fields`, which can be used to quickly - discover which fields were read from a model when you are looking to only - select the data you need from the database. - - *Sean Griffin* - -* Introduce the `:if_exists` option for `drop_table`. - - Example: - - drop_table(:posts, if_exists: true) - - That would execute: - - DROP TABLE IF EXISTS posts - - If the table doesn't exist, `if_exists: false` (the default) raises an - exception whereas `if_exists: true` does nothing. - - *Cody Cutrer*, *Stefan Kanev*, *Ryuta Kamizono* - -* Don't run SQL if attribute value is not changed for update_attribute method. - - *Prathamesh Sonpatki* - -* `time` columns can now get affected by `time_zone_aware_attributes`. If you have - set `config.time_zone` to a value other than `'UTC'`, they will be treated - as in that time zone by default in Rails 5.1. If this is not the desired - behavior, you can set - - ActiveRecord::Base.time_zone_aware_types = [:datetime] - - A deprecation warning will be emitted if you have a `:time` column, and have - not explicitly opted out. - - Fixes #3145. - - *Sean Griffin* - -* Tests now run after_commit callbacks. You no longer have to declare - `uses_transaction ‘test name’` to test the results of an after_commit. - - after_commit callbacks run after committing a transaction whose parent - is not `joinable?`: un-nested transactions, transactions within test cases, - and transactions in `console --sandbox`. - - *arthurnn*, *Ravil Bayramgalin*, *Matthew Draper* - -* `nil` as a value for a binary column in a query no longer logs as - "", and instead logs as just "nil". - - *Sean Griffin* - -* `attribute_will_change!` will no longer cause non-persistable attributes to - be sent to the database. - - Fixes #18407. - - *Sean Griffin* - -* Remove support for the `protected_attributes` gem. - - *Carlos Antonio da Silva*, *Roberto Miranda* - -* Fix accessing of fixtures having non-string labels like Fixnum. - - *Prathamesh Sonpatki* - -* Remove deprecated support to preload instance-dependent associations. - - *Yves Senn* - -* Remove deprecated support for PostgreSQL ranges with exclusive lower bounds. - - *Yves Senn* - -* Remove deprecation when modifying a relation with cached Arel. - This raises an `ImmutableRelation` error instead. - - *Yves Senn* - -* Added `ActiveRecord::SecureToken` in order to encapsulate generation of - unique tokens for attributes in a model using `SecureRandom`. - - *Roberto Miranda* - -* Change the behavior of boolean columns to be closer to Ruby's semantics. - - Before this change we had a small set of "truthy", and all others are "falsy". - - Now, we have a small set of "falsy" values and all others are "truthy" matching - Ruby's semantics. - - *Rafael Mendonça França* - -* Deprecate `ActiveRecord::Base.errors_in_transactional_callbacks=`. - - *Rafael Mendonça França* - -* Change transaction callbacks to not swallow errors. - - Before this change any errors raised inside a transaction callback - were getting rescued and printed in the logs. - - Now these errors are not rescued anymore and just bubble up, as the other callbacks. - - *Rafael Mendonça França* - -* Remove deprecated `sanitize_sql_hash_for_conditions`. - - *Rafael Mendonça França* - -* Remove deprecated `Reflection#source_macro`. - - *Rafael Mendonça França* - -* Remove deprecated `symbolized_base_class` and `symbolized_sti_name`. - - *Rafael Mendonça França* - -* Remove deprecated `ActiveRecord::Base.disable_implicit_join_references=`. - - *Rafael Mendonça França* - -* Remove deprecated access to connection specification using a string accessor. - - Now all strings will be handled as a URL. - - *Rafael Mendonça França* - -* Change the default `null` value for `timestamps` to `false`. - - *Rafael Mendonça França* - -* Return an array of pools from `connection_pools`. - - *Rafael Mendonça França* - -* Return a null column from `column_for_attribute` when no column exists. - - *Rafael Mendonça França* - -* Remove deprecated `serialized_attributes`. - - *Rafael Mendonça França* - -* Remove deprecated automatic counter caches on `has_many :through`. - - *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 Record `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* - -* Clear query cache on rollback. - - *Florian Weingarten* - -* Fix setting of foreign_key for through associations when building a new record. - - Fixes #12698. - - *Ivan Antropov* - -* Improve dumping of the primary key. If it is not a default primary key, - correctly dump the type and options. - - Fixes #14169, #16599. - - *Ryuta Kamizono* - -* Format the datetime string according to the precision of the datetime field. - - Incompatible to rounding behavior between MySQL 5.6 and earlier. - - In 5.5, when you insert `2014-08-17 12:30:00.999999` the fractional part - is ignored. In 5.6, it's rounded to `2014-08-17 12:30:01`: - - http://bugs.mysql.com/bug.php?id=68760 - - *Ryuta Kamizono* - -* Allow a precision option for MySQL datetimes. - - *Ryuta Kamizono* - -* Fixed automatic `inverse_of` for models nested in a module. - - *Andrew McCloud* - -* Change `ActiveRecord::Relation#update` behavior so that it can - be called without passing ids of the records to be updated. - - This change allows updating multiple records returned by - `ActiveRecord::Relation` with callbacks and validations. - - # Before - # ArgumentError: wrong number of arguments (1 for 2) - Comment.where(group: 'expert').update(body: "Group of Rails Experts") - - # After - # Comments with group expert updated with body "Group of Rails Experts" - Comment.where(group: 'expert').update(body: "Group of Rails Experts") - - *Prathamesh Sonpatki* - -* Fix `reaping_frequency` option when the value is a string. - - This usually happens when it is configured using `DATABASE_URL`. - - *korbin* - -* Fix error message when trying to create an associated record and the foreign - key is missing. - - Before this fix the following exception was being raised: - - NoMethodError: undefined method `val' for # - - Now the message is: - - ActiveRecord::UnknownAttributeError: unknown attribute 'foreign_key' for Model. - - *Rafael Mendonça França* - -* Fix change detection problem for PostgreSQL bytea type and - `ArgumentError: string contains null byte` exception with pg-0.18. - - Fixes #17680. - - *Lars Kanis* - -* When a table has a composite primary key, the `primary_key` method for - SQLite3 and PostgreSQL adapters was only returning the first field of the key. - Ensures that it will return nil instead, as Active Record doesn't support - composite primary keys. - - Fixes #18070. - - *arthurnn* - -* `validates_size_of` / `validates_length_of` do not count records - which are `marked_for_destruction?`. - - Fixes #7247. - - *Yves Senn* - -* Ensure `first!` and friends work on loaded associations. - - Fixes #18237. - - *Sean Griffin* - -* `eager_load` preserves readonly flag for associations. - - Fixes #15853. - - *Takashi Kokubun* - -* Provide `:touch` option to `save()` to accommodate saving without updating - timestamps. - - Fixes #18202. - - *Dan Olson* - -* Provide a more helpful error message when an unsupported class is passed to - `serialize`. - - Fixes #18224. - - *Sean Griffin* - -* Add bigint primary key support for MySQL. - - Example: - - create_table :foos, id: :bigint do |t| - end - - *Ryuta Kamizono* - -* Support for any type of primary key. - - Fixes #14194. - - *Ryuta Kamizono* - -* Dump the default `nil` for PostgreSQL UUID primary key. - - *Ryuta Kamizono* - -* Add a `:foreign_key` option to `references` and associated migration - methods. The model and migration generators now use this option, rather than - the `add_foreign_key` form. - - *Sean Griffin* - -* Don't raise when writing an attribute with an out-of-range datetime passed - by the user. - - *Grey Baker* - -* Replace deprecated `ActiveRecord::Tasks::DatabaseTasks#load_schema` with - `ActiveRecord::Tasks::DatabaseTasks#load_schema_for`. - - *Yves Senn* - -* Fix bug with `ActiveRecord::Type::Numeric` that caused negative values to - be marked as having changed when set to the same negative value. - - Fixes #18161. - - *Daniel Fox* - -* Introduce `force: :cascade` option for `create_table`. Using this option - will recreate tables even if they have dependent objects (like foreign keys). - `db/schema.rb` now uses `force: :cascade`. This makes it possible to - reload the schema when foreign keys are in place. - - *Matthew Draper*, *Yves Senn* - -* `db:schema:load` and `db:structure:load` no longer purge the database - before loading the schema. This is left for the user to do. - `db:test:prepare` will still purge the database. - - Fixes #17945. - - *Yves Senn* - -* Fix undesirable RangeError by `Type::Integer`. Add `Type::UnsignedInteger`. - - *Ryuta Kamizono* - -* Add `foreign_type` option to `has_one` and `has_many` association macros. - - This option enables to define the column name of associated object's type for polymorphic associations. - - *Ulisses Almeida*, *Kassio Borges* - -* Remove deprecated behavior allowing nested arrays to be passed as query - values. - - *Melanie Gilman* - -* Deprecate passing a class as a value in a query. Users should pass strings - instead. - - *Melanie Gilman* - -* `add_timestamps` and `remove_timestamps` now properly reversible with - options. - - *Noam Gagliardi-Rabinovich* - -* `ActiveRecord::ConnectionAdapters::ColumnDumper#column_spec` and - `ActiveRecord::ConnectionAdapters::ColumnDumper#prepare_column_options` no - longer have a `types` argument. They should access - `connection#native_database_types` directly. - - *Yves Senn* - -Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/activerecord/CHANGELOG.md) for previous changes. +Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/activerecord/CHANGELOG.md) for previous changes. diff --git a/activerecord/lib/active_record/gem_version.rb b/activerecord/lib/active_record/gem_version.rb index 748d208397b..f33456a7449 100644 --- a/activerecord/lib/active_record/gem_version.rb +++ b/activerecord/lib/active_record/gem_version.rb @@ -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 diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index 154739a6274..773182056be 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -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 => #`. - - *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. diff --git a/activesupport/lib/active_support/gem_version.rb b/activesupport/lib/active_support/gem_version.rb index 79b30abd342..74f2d8dd4bb 100644 --- a/activesupport/lib/active_support/gem_version.rb +++ b/activesupport/lib/active_support/gem_version.rb @@ -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 diff --git a/guides/CHANGELOG.md b/guides/CHANGELOG.md index 6fdd0b20c53..2730d2dfeac 100644 --- a/guides/CHANGELOG.md +++ b/guides/CHANGELOG.md @@ -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. diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index f61713c561c..41fbf9044c8 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -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 ' - - 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 ' - - 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. diff --git a/railties/lib/rails/gem_version.rb b/railties/lib/rails/gem_version.rb index a3a241235f0..9c49e0655ae 100644 --- a/railties/lib/rails/gem_version.rb +++ b/railties/lib/rails/gem_version.rb @@ -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 diff --git a/version.rb b/version.rb index a3a241235f0..9c49e0655ae 100644 --- a/version.rb +++ b/version.rb @@ -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