Commit Graph

70582 Commits

Author SHA1 Message Date
Akira Matsuda 15904ad18c Missing require "active_support/number_helper/number_converter" 2018-10-20 14:58:04 +09:00
Akira Matsuda 6b5d9df877 Missing require "concurrent/hash" 2018-10-20 14:58:04 +09:00
Akira Matsuda 5ab2505084 Missing require "active_support/callbacks" 2018-10-20 14:58:04 +09:00
Akira Matsuda 7d7a607c37 ActiveSupport module may not always already defined here
`ruby -ractive_support/core_ext/range/conversions.rb -ep` dies with uninitialized constant ActiveSupport
2018-10-20 14:58:04 +09:00
Akira Matsuda 1769d93269 Missing require "active_support/dependencies/autoload" 2018-10-20 14:58:04 +09:00
Akira Matsuda 74a4774637 attribute_accessors no longer uses extract_options since a5b0c60714 2018-10-20 14:58:04 +09:00
yuuji.yaginuma 931120d37d Avoid running `webpacker:install` on tests that don't need it
If use `run_generator` to run the generator, `--skip-webpack-install`
is specified automatically.
3101a4136b/railties/lib/rails/generators/testing/behaviour.rb (L71)

However, when executing the generator independently (for example, to use
stub), `webpacker:install` was executed.
Since this includes `yarn install`, it should be avoided in unnecessary
testing.
2018-10-20 14:41:51 +09:00
Esquith Allen 7da3043382 Changed wording for no-response documentation 2018-10-20 00:49:49 -04:00
Olivier Lacan 8990921ba9 Replace outdated Rails Guides logo
The previous version wasn’t matching the Rails Guides logo source file
listed at https://github.com/rails/homepage/blob/master/materials/rails_guides_logo.psd
somehow. It was also a GIF when an 8-bit PNG results in a smaller file (2KB vs 4KB) which
should be just as widely compatible with browsers.

And that’s just for the 1x version. I added a new 2x version for “retina” or high-density
displays and a CSS @media query to progressively enhance with this high density
version of the logo. I’ve ensured that this query is supported across browsers by
using vendor-specific versions when necessary. See:
https://caniuse.com/#feat=css-media-resolution

[ci skip]
2018-10-19 19:27:04 -04:00
Olivier Lacan af6dbcf1ed Shorten unnecessarily long names for Guides
The names are only used in the Guides Index overlay and several of them are
longer than they need to be.

For example “Ruby on Rails” is mentioned over and over again in the Release
Notes section although these are obviously all Rails versions we’re listing.

There’s a Maintenance Policy category with a Maintenance Policy article which
is redundant. Policies makes much more sense as a category.

Similarly, Contributing to Ruby on Rails is both a category and an article.
“Contributions” is a better category title. “Ruby on Rails Guides Guidelines” is
a gigantic mouthful. We are *in* the Rails Guides, we don’t need to specify
what guides we’re talking about here.

As a final added advantage, all of these shortenings make the index much easier
to parse in order to find an article.

[ci skip]
2018-10-19 19:26:56 -04:00
Olivier Lacan 068413431c Use CSS flexbox for Guides index menu
This notably allows us to tile each category without pushing the page down vertically
as much as we previously did on any viewport wider than mobile sizes.

It also means we can fit more guides which will become useful in the future since
we have several new guides in the work.

Finally the new layout allows three clearly distinct columns to emerge:
- Start Here and Rails basics: Models, Views, Controllers, Other Components
- Digging Deeper, Extending Rails, Contributing, Maintenance
- Release Notes

Having Release Notes shoot back up to the top of the third column is great
because that makes finding the latest released version and its associated
release notes much easier without having to scroll down a bunch.

[ci skip]
2018-10-19 19:26:47 -04:00
Richard Schneeman e3111c129a
Merge pull request #34257 from olivierlacan/verbose-query-logs-guides
Add guides section on verbose query logs to Debugging
2018-10-19 12:10:15 -05:00
Matilda Smeds 317f465542 Remove "Upgrading Old Versions" from Asset Pipeline Guide [skip ci]
* How to upgrade Rails 2.x/3.2 not relevant for this Guide
* All configuration changes are already included in Upgrading Ruby on Rails Guide
2018-10-19 19:28:14 +03:00
Olivier Lacan 8c3a228354 Add guides section on verbose query logs to Debugging
Since this is a useful tool in debugging it made sense to document
its existence and usage, especially in the console where it's disabled
by default.

[ci skip]
2018-10-19 11:27:55 -04:00
Francesco Rodríguez 0f7655c325 Remove unnecessary escape character 2018-10-19 15:59:20 +02:00
yuuji.yaginuma 86a12b6f29 Avoid running bundler on tests that don't need it
If the dev option is specified, Gemfile contains gem which specifies GitHub.
This will take time to execute, so should avoid it in unnecessary tests.
2018-10-19 17:56:09 +09:00
Yoshiyuki Kinjo 32b03b4615 Implement AR#inspect using ParamterFilter.
AR instance support `filter_parameters` since #33756.
Though Regex or Proc is valid as `filter_parameters`,
they are not supported as AR#inspect.

I also add :mask option and #filter_params to
`ActiveSupport::ParameterFilter#new` to implement this.
2018-10-19 14:16:03 +09:00
Yuji Yaginuma d197059666
Merge pull request #34256 from y-yagi/make_aj_integration_tests_work_on_ci_2
Make AJ integration tests work in CI
2018-10-19 13:27:25 +09:00
yuuji.yaginuma 7eba11373c Remove an extra `@mutex.synchronize`
Since `@mutex.synchronize` is enforced in the `ensure_connection!` method,
there is no need to do so on the caller side.
c1b47f9c5d/lib/sneakers/publisher.rb (L22-L26)

Due to this, `ThreadError(deadlock; recursive locking)` has occurred.
2018-10-19 12:38:21 +09:00
yuuji.yaginuma 9757c84efe Replace port number 5433 to 5432 which tests expect
Also, replace the authentication setting. This is necessary for using
`psql` with PostgreSQL 10.
Ref: https://github.com/travis-ci/travis-ci/issues/9624#issuecomment-389537036
2018-10-19 12:38:15 +09:00
Yuji Yaginuma f8a2304fde
Merge pull request #34249 from anthonygharvey/fix_testing_guide_typo
Fix typo in testing guide
2018-10-19 09:46:49 +09:00
yuuji.yaginuma 096cb88ce7 Return a non zero code when can not connect to backend on CI 2018-10-19 07:45:47 +09:00
Francesco Rodríguez b0f3070209 Deprecate Unicode's #pack_graphemes and #unpack_graphemes methods
in favor of `array.flatten.pack("U*")` and `string.scan(/\X/).map(&:codepoints)`, respectively.
2018-10-18 14:10:30 -07:00
Yuji Yaginuma 885ab065b5
Merge pull request #34243 from deivid-rodriguez/fix_generated_gemfile_on_jruby
Fix generated Gemfile missing gems on jruby
2018-10-18 19:01:27 +09:00
anthonygharvey e50debf1ae Fix typo in testing guide 2018-10-17 20:50:16 -04:00
Ryuta Kamizono aed7e00039 Don't expose internal `get_value`/`set_value` methods 2018-10-18 08:29:58 +09:00
David Rodríguez 60e6269598
Fix generated Gemfile missing gems on jruby 2018-10-17 12:51:23 -03:00
Richard Schneeman ead868315f
Merge pull request #34197 from schneems/schneems/symbol-hash-respond_to
ActiveRecord#respond_to? No longer allocates strings
2018-10-17 09:17:48 -05:00
Ryuta Kamizono 12c7b101f8 Remove and flip `index: true` for `references` in the doc [ci skip]
Follow up #32146.
2018-10-17 21:43:23 +09:00
Ryuta Kamizono dbb5d57538
Merge pull request #32146 from abhikanojia/association_guide_fix
Remove index:true option from belongs to as defaults to true.

[ci skip]
2018-10-17 21:21:14 +09:00
Yuji Yaginuma 0f74fd1f81
Merge pull request #34233 from lucasprag/update_guide
Update guide for the counter variable when rendering with the `as:` option
2018-10-17 11:47:22 +09:00
Ryuta Kamizono 1198a3880b Consolidate duplicated code that initializing an empty model object
`init_with` and `init_from_db` are almost the same code except decode
`coder`.

And also, named `init_from_db` is a little misreading, a raw values hash
from the database is already converted to an attributes object by
`attributes_builder.build_from_database`, so passed `attributes` in that
method is just an attributes object.

I renamed that method to `init_with_attributes` since the method is
shared with `init_with` to initialize an empty model object.
2018-10-17 10:51:53 +09:00
Lucas Oliveira 8d5a2c4da1 Update guide for the counter variable when rendering with the `as:` option
[ci skip]
2018-10-16 20:52:34 -04:00
Ryuta Kamizono bb0c02e9b5
Merge pull request #34232 from kamipo/check_version
Consistently extract checking version for all adapters
2018-10-17 09:17:42 +09:00
Francesco Rodríguez d234dd677a Refactor Chars#reverse and Chars#grapheme_length
Use \X meta character directly to get grapheme clusters.

Thanks to @mtsmfm for the tip:
https://github.com/rails/rails/pull/34123#issuecomment-429028878

r? @jeremy
2018-10-16 16:32:56 -07:00
Ryuta Kamizono 5b5367364f Consistently extract checking version for all adapters
I don't prefer to extract it for one adapter even though all adapters
also does.

Related to #34227.
2018-10-17 07:24:17 +09:00
Gannon McGibbon 6647341aea
Merge pull request #34231 from brasscapon/rails_five
Fix mapping of content [ci skip]
2018-10-16 17:55:51 -04:00
Trevor Wistaff 2c01714d2d [ci skip] Remove explicit to_s for consistency with other example 2018-10-16 17:38:48 -04:00
Adam Demirel b69a6c3214 Fix mapping of content 2018-10-17 07:57:56 +11:00
Aaron Patterson e53acfde0f
Merge pull request #34227 from bkuhlmann/master-lazy_mysql_version_check_support
Refactored abstract MySQL adapter to support lazy version check.
2018-10-16 13:34:41 -07:00
Gannon McGibbon 45b6ee6aa2
Merge pull request #34220 from bogdanvlviv/follow-up-33571
Clarify docs of `ActiveJob::TestHelper` [ci skip]
2018-10-16 12:59:16 -04:00
Brooke Kuhlmann e1f6821105 Refactored abstract MySQL adapter to support lazy version check.
Will allow sub classes to override the protected
`#check_version` method hook if desired.

For example, this will be most helpful in sub classes that wish
to support lazy initialization because the version check can
be postponed until the connection is ready to be initialized.
2018-10-16 10:09:06 -06:00
Ryuta Kamizono 9a9d5af1e4
Merge pull request #34203 from albertoalmagro/add-habtm-singular-ids-regression-test
Add regression test against has_and_belong_to_many memoized singular_ids
2018-10-16 21:10:50 +09:00
Richard Schneeman 09ca939eab
Merge pull request #34056 from CaDs/CaDs-extend_documentation_for_fetch_multi
Extend doc for ActiveSupport::Cache#fetch_multi
2018-10-16 06:59:17 -05:00
Alberto Almagro 5e92770e5a Add regression test against habtm memoized singular_ids
Starting in Rails 5.0.0 and still present in Rails 5.2.1, `singular_ids`
got memoized and didn't reload after more items were added to the
relation.

Although 19c8071 happens to fix the issue, it only adds tests for
`has_many` relations while this bug only affected
`has_and_belongs_to_many` relations.

This commit adds a regression test to ensure it never happens again with
`habtm` relations.

Ensures #34179 never gets reproduced.
2018-10-16 13:16:09 +02:00
Carlos Donderis cae1b2ce86 Extends documentation for ActiveSupport::Cache#fetch_multi [ci skip] 2018-10-16 11:43:38 +09:00
Ryuta Kamizono b0b0cd1fd7 Merge pull request #29204 from RasPat1/issue-29200-scaffold-reference-display-memory-address
Issue #29200 scaffold an object with a reference displays an object memory address to user
2018-10-16 10:30:55 +09:00
Ryuta Kamizono b7c29fc962 Merge pull request #33075 from fedxgibson/pg_ambigous_column_cache_key_limit_custom_select
Fix Collection cache key with limit and custom select
2018-10-16 09:54:21 +09:00
Federico Martinez b1aeae0494 Fix Collection cache key with limit and custom select (PG:AmbigousColumn: Error)
Change query to use alias name for timestamp_column to avoid ambiguity problems when using timestamp from subquery.
2018-10-15 20:38:12 -03:00
bogdanvlviv 4f1295129b
Unify changelog entries related to `database` option of Rails generators [ci skip]
`migrations_paths` option was added to migration generator, with
changelog entry, in #33760.
Also `migrations_paths` option was added to model generator, with
changelog entry, in #33994.
Then `migrations_paths` was renamed to `database` and aliased as `db`
in #34021, and was added new changelog entry.
I think we should edit existed changelog entries instead adding new
about changing the name of the option from `migrations_paths` to `database`
since Rails 6.0 hasn't been released yet, and since It might confuse
readers of the changelog file in case if they've read changelog enty about
adding `migrations_paths` option but haven't read the entry about
change the name of that option to `database`.
@eileencodes, @gmcgibbon, @rafaelfranca Does it make sense?
2018-10-16 02:07:45 +03:00