Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5 1 stable #32423

Closed
wants to merge 539 commits into from
Closed

5 1 stable #32423

wants to merge 539 commits into from

Conversation

wshpoon
Copy link

@wshpoon wshpoon commented Apr 2, 2018

Summary

Provide a general description of the code changes in your pull
request... were there any bugs you had fixed? If so, mention them. If
these bugs have open GitHub issues, be sure to tag them here as well,
to keep the conversation linked together.

Other Information

If there's anything else that's important and relevant to your pull
request, mention that information here. This could include
benchmarks, or other information.

If you are updating any of the CHANGELOG files or are asked to update the
CHANGELOG files by reviewers, please add the CHANGELOG entry at the top of the file.

Finally, if your pull request affects documentation or any non-code
changes, guidelines for those changes are available
here

Thanks for contributing to Rails!

kamipo and others added 30 commits July 16, 2017 20:58
Replace Erubis with Erubi in a part of guide [ci skip]
This change was introduced by #18109. The intent of that change was to
specifically apply `unscoped`, not to allow all changes to
`current_scope` to affect the join. The idea of allowing `current_scope`
to affect joins is interesting and potentially more consistent, but has
sever problems associated with it. The fact that we're specifically
stripping out joins indicates one such problem (and potentially leads to
invalid queries).

Ultimately it's difficult to reason about what `Posts.joins(:users)`
actually means if it's affected by `User.current_scope`, and it's
difficult to specifically control what does or doesn't get added. If we
were starting from scratch, I don't think I'd have `joins` be affected
by `default_scope` either, but that's too big of a breaking change to
make at this point.

With this change, we no longer apply `current_scope` when bringing in
joins, with the singular exception of the motivating use case which
introduced this bug, which is providing a way to *opt-out* of having the
default scope apply to joins.

Fixes #29338.
…ivesupport-railsguide

Added fixed links to code for Rails Guides ActiveSupport
…_msg

Scrub the invalid paramter value before using it in the error
…fault

Fix HashWithIndifferentAccess#default when include?(nil)
…fault_5_1

Merge pull request #29757 from lugray/hash_with_indifferent_access_default
…cation_file

Set `RAILS_ENV` before load application file
Create `rails@localhost` user on travis ci
`test_middleware_caches` is sometimes failed since #29454.
The failure is due to schema statements are affected by query caching.
Bypassing query caching for schema statements to avoid the issue.
Currently `version` method always returns `5.5.5` because the
`full_version` is `5.5.5-10.x.y-MariaDB...` since MariaDB 10.x.
It should be ignored if the prefix is `5.5.5-`.
Since MariaDB 10.2.5, `information_schema` supports Virtual Columns.

Fixes #29670.
Since MariaDB 10.2, `CURRENT_TIMESTAMP` is shown as a function
(`current_timestamp()`). Fix matching column default to address that
case.

Fixes #29698.
Since 5c71000, it has lost to be able to unscope `default_scope` in STI
associations. This change will use `.empty_scope?` instead of
`.values.empty?` to regard as an empty scope if only have
`type_condition`.
…sometimes

Post.where(id: 1).or(Post.where(id: 2)).where(foo: 3).unscope(where: :foo).where_clause.binds.map(&:value)
Would return [2, 3] instead of the expected [1,2]
Match destroyed_by_association for has_one to has_many
Updates Rails upgrade guide on `ActionView::Helpers::RecordTagHelper`
5-1-stable: Fix unscoping `default_scope` in STI associations
5-1-stable: Don't cache queries for schema statements
…nd_virtual_columns

5-1-stable: Fix default `CURRENT_TIMESTAMP` and Virtual Columns for MariaDB 10.2
…r_5-1

5-1-stable: bugfix: unscope(where: [columns]) would not remove the correct binds sometimes
Delegate respond_to? in ActionView::Helpers::ControllerHelper
Do not show URL in boot info when using Puma
…nd_limit

Fix `COUNT(DISTINCT ...)` with `ORDER BY` and `LIMIT`
5-1-stable: Don't cache queries for schema statements
kamipo and others added 27 commits March 6, 2018 04:55
…imistic locking is enabled

This issue is caused by `@_trigger_update_callback` won't be updated due
to `_update_record` in `Locking::Optimistic` doesn't call `super` when
optimistic locking is enabled.

Now optimistic locking concern when updating is supported by
`_update_row` low level API, therefore overriding `_update_record` is no
longer necessary.

Removing the method just fix the issue.

Closes #29096.
Closes #29321.
Closes #30823.
5-1-stable: Fix that after commit callbacks on update does not triggered when optimistic locking is enabled
#30748 was backported to `5-1-stable`
by 3789531.
This commit adds missing changelog entry and fixes others.
Add `ActiveRecord::Migration.verbose = true`
to be sure that verbose is turned on in the test.

Related to #28865
#32262)

* Check exclude before flagging cookies as secure.

* Update comments in ActionDispatch::SSL.

[Catherine Khuu + Rafael Mendonça França]
This test fails in specific time.
Example:

If run this test on the machine with time 01:00 am UTC+2,
this test will fail.
Changing representing of 2000-01-01 01:00 am UTC+2 to UTC+0 change
the day, month and even year in our case,
so substitution `"2000-01-01 "` to `""` isn't possible.

```
Failure:
ActiveRecord::ConnectionAdapters::QuotingTest#test_quoted_time_utc
Expected: "1999-12-31 23:01:27"
  Actual: "23:01:27"
```

Related to 7c479cb
Fix digesting templates with mixed formats
The urls helpers module returned by Rails.application.routes.url_helpers
isn't cached so to prevent the cost of building the module cache it locally.
Somehow `test_config_another_database` didn't fail on CI, but it will
fail locally.

https://travis-ci.org/rails/rails/jobs/356212950#L2474-L2482

```
% bundle exec ruby -w -Itest test/generators/app_generator_test.rb -n test_config_another_database
Run options: -n test_config_another_database --seed 7260

# Running:

F

Failure:
AppGeneratorTest#test_config_another_database [test/generators/app_generator_test.rb:417]:
Expected /^\s*gem\s+["']mysql2["'], '~> 0.4.4'$*/ to match "source 'https://rubygems.org'\ngit_source(:github) { |repo| \"https://github.com/\#{repo}.git\" }\n\nruby '2.5.0'\n\n# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'\ngem 'rails', '~> 6.0.0.alpha'\n# Use mysql as the database for Active Record\ngem 'mysql2', '>= 0.4.4', '< 0.6.0'\n# Use Puma as the app server\ngem 'puma', '~> 3.11'\n# Use SCSS for stylesheets\ngem 'sass-rails', '~> 5.0'\n# Use Uglifier as compressor for JavaScript assets\ngem 'uglifier', '>= 1.3.0'\n# See https://github.com/rails/execjs#readme for more supported runtimes\n# gem 'mini_racer', platforms: :ruby\n\n# Use CoffeeScript for .coffee assets and views\ngem 'coffee-rails', '~> 4.2'\n# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks\ngem 'turbolinks', '~> 5'\n# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder\ngem 'jbuilder', '~> 2.5'\n# Use Redis adapter to run Action Cable in production\n# gem 'redis', '~> 4.0'\n# Use ActiveModel has_secure_password\n# gem 'bcrypt', '~> 3.1.7'\n\n# Use ActiveStorage variant\n# gem 'mini_magick', '~> 4.8'\n\n# Use Capistrano for deployment\n# gem 'capistrano-rails', group: :development\n\n# Reduces boot times through caching; required in config/boot.rb\ngem 'bootsnap', '>= 1.1.0', require: false\n\ngroup :development, :test do\n  # Call 'byebug' anywhere in the code to stop execution and get a debugger console\n  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]\nend\n\ngroup :development do\n  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.\n  gem 'web-console', '>= 3.3.0'\n  gem 'listen', '>= 3.0.5', '< 3.2'\n  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring\n  gem 'spring'\n  gem 'spring-watcher-listen', '~> 2.0.0'\nend\n\ngroup :test do\n  # Adds support for Capybara system testing and selenium driver\n  gem 'capybara', '>= 2.15', '< 4.0'\n  gem 'selenium-webdriver'\n  # Easy installation and use of chromedriver to run system tests with Chrome\n  gem 'chromedriver-helper'\nend\n\n# Windows does not include zoneinfo files, so bundle the tzinfo-data gem\ngem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]\n".

bin/rails test test/generators/app_generator_test.rb:411

Finished in 0.174681s, 5.7247 runs/s, 34.3483 assertions/s.
1 runs, 6 assertions, 1 failures, 0 errors, 0 skips
```
…le-30748

Fix changelog entries of `5-1-stable` [ci skip]
The multiple assignments was caused by 37a1dfa due to lost the `to_s`
normalization for given names.

Fixes #32323.
Also switch testing of ruby-head to ruby-2.5.1 since focus of
future compatibility has switched to 5-2-stable and master.
The removal of path separators from the tmpname value affects all four
supported versions of Ruby - 2.2.10, 2.3.7, 2.4.4, and 2.5.1.
Sidekiq has a version check error for Ruby 2.2.10.
@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @rafaelfranca (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review.

Please see the contribution instructions for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet