aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Avoid running `webpacker:install` on tests that don't need ityuuji.yaginuma2018-10-202-6/+10
| | | | | | | | | | | If use `run_generator` to run the generator, `--skip-webpack-install` is specified automatically. https://github.com/rails/rails/blob/3101a4136bd62787e252d2658eee23001036fa0f/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.
* Merge pull request #34257 from olivierlacan/verbose-query-logs-guidesRichard Schneeman2018-10-191-6/+43
|\ | | | | Add guides section on verbose query logs to Debugging
| * Add guides section on verbose query logs to DebuggingOlivier Lacan2018-10-191-6/+43
| | | | | | | | | | | | | | | | 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]
* | Avoid running bundler on tests that don't need ityuuji.yaginuma2018-10-191-3/+3
| | | | | | | | | | 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.
* | Merge pull request #34256 from y-yagi/make_aj_integration_tests_work_on_ci_2Yuji Yaginuma2018-10-195-18/+30
|\ \ | | | | | | Make AJ integration tests work in CI
| * | Remove an extra `@mutex.synchronize`yuuji.yaginuma2018-10-191-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | Since `@mutex.synchronize` is enforced in the `ensure_connection!` method, there is no need to do so on the caller side. https://github.com/jondot/sneakers/blob/c1b47f9c5d5a95da728bbe1700795790e4efbb12/lib/sneakers/publisher.rb#L22-L26 Due to this, `ThreadError(deadlock; recursive locking)` has occurred.
| * | Replace port number 5433 to 5432 which tests expectyuuji.yaginuma2018-10-191-2/+21
| | | | | | | | | | | | | | | | | | 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
| * | Return a non zero code when can not connect to backend on CIyuuji.yaginuma2018-10-194-4/+8
| |/
* | Merge pull request #34249 from anthonygharvey/fix_testing_guide_typoYuji Yaginuma2018-10-191-1/+1
|\ \ | |/ |/| Fix typo in testing guide
| * Fix typo in testing guideanthonygharvey2018-10-171-1/+1
| |
* | Deprecate Unicode's #pack_graphemes and #unpack_graphemes methodsFrancesco Rodríguez2018-10-183-4/+21
| | | | | | | | in favor of `array.flatten.pack("U*")` and `string.scan(/\X/).map(&:codepoints)`, respectively.
* | Merge pull request #34243 from deivid-rodriguez/fix_generated_gemfile_on_jrubyYuji Yaginuma2018-10-181-1/+1
|\ \ | |/ |/| Fix generated Gemfile missing gems on jruby
| * Fix generated Gemfile missing gems on jrubyDavid Rodríguez2018-10-171-1/+1
| |
* | Don't expose internal `get_value`/`set_value` methodsRyuta Kamizono2018-10-182-11/+9
|/
* Merge pull request #34197 from schneems/schneems/symbol-hash-respond_toRichard Schneeman2018-10-173-12/+11
|\ | | | | ActiveRecord#respond_to? No longer allocates strings
| * ActiveRecord#respond_to? No longer allocates stringsschneems2018-10-153-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an alternative to https://github.com/rails/rails/pull/34195 The active record `respond_to?` method needs to do two things if `super` does not say that the method exists. It has to see if the "name" being passed in represents a column in the table. If it does then it needs to pass it to `has_attribute?` to see if the key exists in the current object. The reason why this is slow is that `has_attribute?` needs a string and most (almost all) objects passed in are symbols. The only time we need to allocate a string in this method is if the column does exist in the database, and since these are a limited number of strings (since column names are a finite set) then we can pre-generate all of them and use the same string. We generate a list hash of column names and convert them to symbols, and store the value as the string name. This allows us to both check if the "name" exists as a column, but also provides us with a string object we can use for the `has_attribute?` call. I then ran the test suite and found there was only one case where we're intentionally passing in a string and changed it to a symbol. (However there are tests where we are using a string key, but they don't ship with rails). As re-written this method should never allocate unless the user passes in a string key, which is fairly uncommon with `respond_to?`. This also eliminates the need to special case every common item that might come through the method via the `case` that was originally added in https://github.com/rails/rails/commit/f80aa5994603e684e3fecd3f53bfbf242c73a107 (by me) and then with an attempt to extend in https://github.com/rails/rails/pull/34195. As a bonus this reduces 6,300 comparisons (in the CodeTriage app homepage) to 450 as we also no longer need to loop through the column array to check for an `include?`.
* | Remove and flip `index: true` for `references` in the doc [ci skip]Ryuta Kamizono2018-10-173-9/+9
| | | | | | | | Follow up #32146.
* | Merge pull request #32146 from abhikanojia/association_guide_fixRyuta Kamizono2018-10-171-10/+10
|\ \ | | | | | | | | | | | | Remove index:true option from belongs to as defaults to true. [ci skip]
| * | Remove index:true option from belongs to as defaults to true.abhishekkanojia2018-03-011-10/+10
| | |
* | | Merge pull request #34233 from lucasprag/update_guideYuji Yaginuma2018-10-171-1/+1
|\ \ \ | | | | | | | | Update guide for the counter variable when rendering with the `as:` option
| * | | Update guide for the counter variable when rendering with the `as:` optionLucas Oliveira2018-10-161-1/+1
| | | | | | | | | | | | | | | | [ci skip]
* | | | Consolidate duplicated code that initializing an empty model objectRyuta Kamizono2018-10-172-20/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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.
* | | | Merge pull request #34232 from kamipo/check_versionRyuta Kamizono2018-10-174-27/+29
|\ \ \ \ | |/ / / |/| | | Consistently extract checking version for all adapters
| * | | Consistently extract checking version for all adaptersRyuta Kamizono2018-10-174-27/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I don't prefer to extract it for one adapter even though all adapters also does. Related to #34227.
* | | | Refactor Chars#reverse and Chars#grapheme_lengthFrancesco Rodríguez2018-10-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge pull request #34231 from brasscapon/rails_fiveGannon McGibbon2018-10-161-1/+1
|\ \ \ \ | |/ / / |/| | | Fix mapping of content [ci skip]
| * | | Fix mapping of contentAdam Demirel2018-10-171-1/+1
| | | |
* | | | Merge pull request #34227 from bkuhlmann/master-lazy_mysql_version_check_supportAaron Patterson2018-10-161-4/+11
|\ \ \ \ | | | | | | | | | | Refactored abstract MySQL adapter to support lazy version check.
| * | | | Refactored abstract MySQL adapter to support lazy version check.Brooke Kuhlmann2018-10-161-4/+11
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #34220 from bogdanvlviv/follow-up-33571Gannon McGibbon2018-10-161-3/+3
|\ \ \ \ | | | | | | | | | | Clarify docs of `ActiveJob::TestHelper` [ci skip]
| * | | | Clarify docs of `ActiveJob::TestHelper` [ci skip]bogdanvlviv2018-10-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I found a few sentences that should be updated as well. See https://github.com/rails/rails/pull/33571#discussion_r209435886 Follow up #33571
* | | | | Merge pull request #34203 from ↵Ryuta Kamizono2018-10-161-0/+12
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | albertoalmagro/add-habtm-singular-ids-regression-test Add regression test against has_and_belong_to_many memoized singular_ids
| * | | | | Add regression test against habtm memoized singular_idsAlberto Almagro2018-10-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | Merge pull request #34056 from CaDs/CaDs-extend_documentation_for_fetch_multiRichard Schneeman2018-10-161-2/+11
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Extend doc for ActiveSupport::Cache#fetch_multi
| * | | | | Extends documentation for ActiveSupport::Cache#fetch_multi [ci skip]Carlos Donderis2018-10-161-2/+11
| | | | | |
* | | | | | Merge pull request #29204 from ↵Ryuta Kamizono2018-10-164-5/+21
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RasPat1/issue-29200-scaffold-reference-display-memory-address Issue #29200 scaffold an object with a reference displays an object memory address to user
| * | | | | | Show object ids in scaffold pages when displaying referenced objectsRasesh Patel2018-10-144-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolve Issue#29200 When scaffolding a model that references another model the generated show and index html pages display the object directly on the page. Basically, it just shows a memory address. That is not very helpful. In this commit we show the object's id rather than the memory address. This updates the scaffold templates and the json builder files.
* | | | | | | Merge pull request #33075 from ↵Ryuta Kamizono2018-10-163-2/+22
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | fedxgibson/pg_ambigous_column_cache_key_limit_custom_select Fix Collection cache key with limit and custom select
| * | | | | | Fix Collection cache key with limit and custom select (PG:AmbigousColumn: Error)Federico Martinez2018-10-153-2/+22
|/ / / / / / | | | | | | | | | | | | | | | | | | Change query to use alias name for timestamp_column to avoid ambiguity problems when using timestamp from subquery.
* | | | | | Deprecate ActiveSupport::Multibyte::Chars.consumes?Francesco Rodríguez2018-10-153-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In favor of String#is_utf8?. I think this method was made for internal use only, and its usage was removed here: https://github.com/rails/rails/pull/8261/files#diff-ce956ebe93786930e40f18db1da5fd46L39.
* | | | | | Merge pull request #34214 from brasscapon/rails_fiveRyuta Kamizono2018-10-151-1/+1
|\ \ \ \ \ \ | |_|_|/ / / |/| | | / / | | |_|/ / | |/| | | Update snippet to rails 5 syntax [ci skip]
| * | | | Update snippet to rails 5 syntaxAdam Demirel2018-10-151-1/+1
| | | | |
* | | | | Fix `ActionController::Parameters#each_value` and add changelog entry to ↵Bogdan2018-10-153-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this method (#34210) * Fix `ActionController::Parameters#each_value` `each_value` should yield with "value" of the params instead of "value" as an array. Related to #33979 * Add changelog entry about `ActionController::Parameters#each_value`. Follow up #33979
* | | | | Merge pull request #34135 from Edouard-chin/ec-rounded-durationAndrew White2018-10-153-3/+12
|\ \ \ \ \ | | | | | | | | | | | | Fix issue where duration where always rounded up to a second:
| * | | | | Fix issue where duration where always rounded up to a second:Edouard CHIN2018-10-123-3/+12
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Adding a Float as a duration to a datetime would result in the Float being rounded. Doing something like would have no effect because the 0.45 seconds would be rounded to 0 second. ```ruby time = DateTime.parse("2018-1-1") time += 0.45.seconds ``` This behavior was intentionally added a very long time ago, the reason was because Ruby 1.8 was using `Integer#gcd` in the constructor of Rational which didn't accept a float value. That's no longer the case and doing `Rational(0.45, 86400)` would now perfectly work fine. - Fixes #34008
* | | | | Ensure to test that `project.developers` is ordered by `developers.name desc`Ryuta Kamizono2018-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `developers.name desc` was added at d59f3a7, but any test case isn't failed even if the `developers.name desc` is removed since all tested developers are consistently ordered on both `name` and `id`. I changed one developers creation ordering to ensure to test that `project.developers` is ordered by `developers.name desc`.
* | | | | Merge pull request #34209 from y-yagi/fix_tests_on_mail_271Yuji Yaginuma2018-10-152-5/+5
|\ \ \ \ \ | |/ / / / |/| | | | Fix tests on Mail 2.7.1
| * | | | Fix tests on Mail 2.7.1yuuji.yaginuma2018-10-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up to `2.7.0`, encoding was chosen using `Mail::Encodings::TransferEncoding.negotiate`, and base64 encoding was used. In `2.7.1`, when `transfer_encoding` is not specified, the encoding of the message is respected. Related to: https://github.com/mikel/mail/commit/dead487e02f592d9058fd07deedcde39b569d18d However, what chosen for transfer encoding is not essential in these tests. To test more accurately, confirm that the decoded body instead.
| * | | | Bump mail to `2.7.1`yuuji.yaginuma2018-10-141-1/+1
|/ / / /
* | | | Improve model attribute accessor method names for backtracesDylan Thacker-Smith2018-10-125-75/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ruby uses the original method name, so will show the __temp__ method name in the backtrace. However, in the common case the method name is compatible with the `def` keyword, so we can avoid the __temp__ method name in that case to improve the name shown in backtraces or TracePoint#method_id.