aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Include `ActiveSupport::Testing::MethodCallAssertions` to ↵bogdanvlviv2018-06-0813-36/+3
| | | | | | | | | `ActionCable::TestCase` Remove all `include ActiveSupport::Testing::MethodCallAssertions` in actioncable's tests since we can do it only in `ActionCable::TestCase` in order to prevent code duplication. We use the same approach for other modules of Rails.
* Inherit all actioncable's test classes from `ActionCable::TestCase`bogdanvlviv2018-06-089-9/+9
| | | | | | We have defined `ActionCable::TestCase` in `actioncable/test/test_helper.rb` that we can use in order to prevent code duplication and build common interface for actioncable's test.
* Merge pull request #33089 from bogdanvlviv/refactor-attached_test.rbGeorge Claghorn2018-06-071-19/+21
|\ | | | | Refactor activestorage/test/models/attached_test.rb
| * Refactor activestorage/test/models/attached_test.rbbogdanvlviv2018-06-071-19/+21
| | | | | | | | | | | | | | | | | | | | | | Don't include `ActiveJob::TestHelper` since there is no test that uses it. Ensure removing of overridden User's methods. Related to https://github.com/rails/rails/pull/33085#issuecomment-395548563 Module#remove_method is private in Ruby 2.4. Related to fd0bd1bf682622f064ac437ceee4e1b2a6b6d3b9
* | Revert "Merge pull request #33085 from bogdanvlviv/refactor-attached_test.rb"George Claghorn2018-06-071-21/+19
| | | | | | | | | | This reverts commit 07c035e72dd2267c2a45a7ddd2450687d6329b5b, reversing changes made to 7b33903d7f30027fe99e4632c5517f0c469b3424.
* | Merge pull request #33085 from bogdanvlviv/refactor-attached_test.rbGeorge Claghorn2018-06-071-19/+21
|\ \ | | | | | | Refactor activestorage/test/models/attached_test.rb
| * | Refactor activestorage/test/models/attached_test.rbbogdanvlviv2018-06-071-19/+21
| |/ | | | | | | | | | | | | | | | | Don't include `ActiveJob::TestHelper` since there is no test that uses it. Ensure removing of overridden User's methods. Don't use `send` to execute `remove_method` since it is public. Related to fd0bd1bf682622f064ac437ceee4e1b2a6b6d3b9
* | Merge pull request #33086 from bogdanvlviv/fix-index_with-in-guideGeorge Claghorn2018-06-071-2/+2
|\ \ | |/ |/| Fix example of `index_with`
| * Fix example of `index_with`bogdanvlviv2018-06-071-2/+2
|/ | | | | | | | | | - Clarify executor of `public_send`. - Do not wrap `Interval.all_day` into [] since an array is expected as a returned value. Related to #32523. [ci skip]
* Escape newlines in the GCS private key for valid YAML [ci skip]George Claghorn2018-06-061-1/+1
|
* Fix GROUP BY queries to apply LIMIT/OFFSET after aggregationsRyuta Kamizono2018-06-072-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If `eager_loading` is true, `apply_join_dependency` force applies LIMIT/OFFSET before JOINs by `limited_ids_for` to keep parent records count. But for aggregation queries, LIMIT/OFFSET should be applied after aggregations the same as SQL semantics. And also, we could not replace SELECT list by `limited_ids_for` when a query has a GROUP BY clause. It had never been worked since it will causes generating invalid SQL for MySQL, PostgreSQL, and probably most backends. ``` % ARCONN=postgresql be ruby -w -Itest test/cases/calculations_test.rb -n test_group_by_with_limit Using postgresql Run options: -n test_group_by_with_limit --seed 20925 # Running: E Error: CalculationsTest#test_group_by_with_limit: ActiveRecord::StatementInvalid: PG::GroupingError: ERROR: column "posts.id" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT DISTINCT "posts"."id", "posts"."type" AS alias_0 FRO... ^ : SELECT DISTINCT "posts"."id", "posts"."type" AS alias_0 FROM "posts" LEFT OUTER JOIN "comments" ON "comments"."post_id" = "posts"."id" GROUP BY "posts"."type" ORDER BY "posts"."type" ASC LIMIT $1 ``` Fixes #8103. Closes #27249.
* Fix `collection.create` to could be rolled back by `after_save`Ryuta Kamizono2018-06-073-3/+30
| | | | | | | | | | | In `_create_record`, explicit `transaction` block requires rollback handling manually when `insert_record` is failed. We need to handle it in `_create_record`, not in `insert_record`, since our test cases expect a record added to target and returned even if `insert_record` is failed, Closes #31488.
* Reuse existing model for testing duplicated children recordsRyuta Kamizono2018-06-073-19/+13
| | | | Follow up of #32952.
* Merge pull request #33067 from kamipo/fix_force_equalityRafael França2018-06-063-1/+11
|\ | | | | Fix force equality checking not to break the serialized attribute with Array
| * Fix force equality checking not to break the serialized attribute with ArrayRyuta Kamizono2018-06-063-1/+11
| | | | | | | | Context: https://github.com/rails/rails/commit/43ef00e5d7a55ad79bc840276d33cb70f1f5dde5#commitcomment-29256140
* | Merge pull request #33066 from chalofa/alias_child_joinsRyuta Kamizono2018-06-062-2/+27
|\ \ | |/ |/| Child joins should be aliased when merging relations
| * Child joins should be aliased when merging relationsChalo Fernandez2018-06-062-2/+27
|/ | | | | | | | | | | | | | | | | | | | | | Rails 5.2 does not alias child joins, causing an error about duplicated table/fields: Example: Using some code like: `Post.joins(:author, :categorizations).merge(Author.select(:id)).merge(Categorization.joins(:author))` *Before this fix:* ` SELECT ... FROM "posts" INNER JOIN "authors" ON ... INNER JOIN "authors" ON ... ` *After this fix:* ` SELECT ... FROM "posts" INNER JOIN "authors" ON ... INNER JOIN "authors" "authors_categorizations" ON ... ` Before 5.2, Rails aliased the joins, but wrongfully transformed them into a LEFT OUTER JOIN. This fix will keep them as INNER JOINS, but make sure child joins are aliased, to avoid errors.
* Merge pull request #33051 from SamSaffron/masterMatthew Draper2018-06-063-3/+3
|\ | | | | PERF: avoid allocating column names where possible
| * PERF: avoid allocating column names where possibleSam2018-06-063-3/+3
| | | | | | | | | | | | | | | | | | | | | | When requesting columns names from database adapters AR:Result would dup/freeze column names, this prefers using fstrings which cuts down on repeat allocations Attributes that are retained keep these fstrings around for the long term Note, this has the highest impact on "short" result sets, eg: Topic.first where you can void allocating the number of columns * String.
* | Merge pull request #33029 from fedxgibson/raise_with_duplicate_columnsEileen M. Uchitelle2018-06-043-2/+23
|\ \ | | | | | | Migrations will raise an exception if there are multiple column defin…
| * | Migrations will raise an exception if there are multiple column definitions ↵Federico Martinez2018-06-013-2/+23
| | | | | | | | | | | | (same name).
* | | Merge pull request #33047 from artfuldodger/patch-3Eileen M. Uchitelle2018-06-041-1/+1
|\ \ \ | | | | | | | | Fix testing guide typo
| * | | Fix testing guide typoJon Evans2018-06-011-1/+1
| | |/ | |/|
* | | Merge pull request #33053 from lazyatom/patch-3Ryuta Kamizono2018-06-051-1/+1
|\ \ \ | | | | | | | | | | | | | | | | Correct default value of `unknown_asset_fallback` [ci skip]
| * | | Correct default value of `unknown_asset_fallback`James Adam2018-06-041-1/+1
|/ / / | | | | | | | | | | | | `Rails.application.config.assets.unknown_asset_fallback` now defaults to `false` in an unmodified Rails application. [ci skip]
* | | Initialization block is a part of `build_record`Ryuta Kamizono2018-06-047-14/+22
| | | | | | | | | | | | Should be done before `before_add` callbacks.
* | | Don't expose `Enumerable#_original_sum_with_required_identity` which is ↵yuuji.yaginuma2018-06-041-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | internal API [ci skip] `:nodoc:` is specified, but unfortunately, it is exposed in the API doc. http://edgeapi.rubyonrails.org/classes/Enumerable.html#method-i-_original_sum_with_required_identity If the method of the `alias` destination is public, the specification of `:nodoc:` does not seem to work.
* | | Exclude upload time from instrumented preview timeGeorge Claghorn2018-06-031-5/+10
| | |
* | | Fix `save` in `after_create_commit` won't invoke extra `after_create_commit`Ryuta Kamizono2018-06-042-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since a record is already persisted in `after_create_commit`, so `save` should invoke only `after_update_commit`. This bug is caused by depending on `@_start_transaction_state` for rollback to consider whether it was `new_record` before being committed. If after commit callbacks caused another commit, the state before last commit is no longer `new_record`. Fixes #32831. Closes #18367. Closes #31106.
* | | Remove unnecessary testyuuji.yaginuma2018-06-032-8/+2
| | | | | | | | | | | | | | | Since #32289, `Spellchecker.suggest` returns only one value, multiple suggestions not output.
* | | `record.destroy` on new record won't invoke after create commit callbacksRyuta Kamizono2018-06-032-1/+9
|/ / | | | | | | Fixes #32806.
* | Merge pull request #33039 from ↵Prem Sichanugrist2018-06-021-1/+1
|\ \ | |/ |/| | | | | ybakos/guides/layouts_and_rendering_class_spelling_fix Capitalize class name 'Product' in layouts and rendering guide.
| * Capitalize class name 'Product'.Yong Bakos2018-06-011-1/+1
| | | | | | | | | | In this context, the phrase 'product instance' refers to the Product class, so capitalize it.
* | Merge pull request #33018 from kddeisz/defined-attachmentsRafael França2018-06-016-24/+147
|\ \ | | | | | | ActiveStorage reflection
| * | Ensure reflection_class_for is privateKevin Deisz2018-05-312-36/+40
| | |
| * | Move ActiveStorage reflection logic entirely into ActiveStorageKevin Deisz2018-05-314-46/+76
| | |
| * | Reflection for attachmentsKevin Deisz2018-05-304-17/+106
| | | | | | | | | | | | Add the ability to reflect on the attachments that have been defined using ActiveRecord::Reflection.
* | | Merge pull request #33040 from ↵George Claghorn2018-06-011-2/+2
|\ \ \ | | | | | | | | | | | | | | | | ybakos/guides/active_storage_overview_example_syntax_fix Remove 'Current.' prefix from example.
| * | | Remove 'Current.' prefix from example.Yong Bakos2018-06-011-2/+2
| | |/ | |/| | | | | | | | | | The prior sentence is referring just to an existing user object, so the sudden magical 'Current.' prefix doesn't make sense. Remove it.
* | | Merge pull request #33028 from yahonda/use_mariadb10_3Ryuta Kamizono2018-06-012-2/+4
|\ \ \ | | | | | | | | CI against MariaDB 10.3
| * | | CI against MariaDB 10.3Yasuo Honda2018-06-012-2/+4
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - MariaDB 10.3.7 is the first GA release https://mariadb.com/kb/en/library/mariadb-1037-release-notes/ - MariaDB 10.3 translates `LENGTH()` to `OCTET_LENGTH()` function https://mariadb.com/kb/en/library/sql_modeoracle-from-mariadb-103/ > MariaDB translates LENGTH() to OCTET_LENGTH() - MySQL does NOT translate `LENGTH()` to `OCTET_LENGTH()` However, it translates `OCTET_LENGTH()` to `LENGTH()` Here are generated schema dumps of this test to show the differences between MySQL and MariaDB: * MySQL 8.0 (Server version: 8.0.11 MySQL Community Server - GPL) ```ruby create_table \"virtual_columns\", options: \"ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci\", force: :cascade do |t| t.string \"name\" t.virtual \"upper_name\", type: :string, as: \"upper(`name`)\" t.virtual \"name_length\", type: :integer, as: \"length(`name`)\", stored: true t.virtual \"name_octet_length\", type: :integer, as: \"length(`name`)\", stored: true end ``` * Maria DB 10.3 (Server version: 10.3.7-MariaDB-1:10.3.7+maria~bionic-log mariadb.org binary distribution) ```ruby create_table \"virtual_columns\", options: \"ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci\", force: :cascade do |t| t.string \"name\" t.virtual \"upper_name\", type: :string, as: \"ucase(`name`)\" t.virtual \"name_length\", type: :integer, as: \"octet_length(`name`)\", stored: true t.virtual \"name_octet_length\", type: :integer, as: \"octet_length(`name`)\", stored: true end ```
* | | Merge pull request #33041 from yahonda/add_changelog_to_bump_sqlite3Ryuta Kamizono2018-06-011-0/+4
|\ \ \ | |_|/ |/| | [skip ci] Add changelog about bumping minimum SQLite version to 3.8
| * | [skip ci] Add changelog about bumping minimum SQLite version to 3.8Yasuo Honda2018-06-011-0/+4
|/ / | | | | | | Related to #32923
* | Merge pull request #33034 from utilum/remove_mocha_from_action_cableRafael França2018-05-3111-52/+120
|\ \ | | | | | | Remove mocha from action cable
| * | Remove mocha from ActionCable testsutilum2018-05-311-1/+0
| | | | | | | | | | | | Q.E.D.
| * | Use Ruby instead of mochautilum2018-05-313-6/+19
| | |
| * | Use minitest/mock instead of mochautilum2018-05-318-45/+101
|/ /
* | Merge pull request #33033 from mikegee/patch-1Kasper Timm Hansen2018-05-311-1/+1
|\ \ | | | | | | "brethen" is misspelled and could be clearer
| * | [ci skip] "brethen" is misspelled and unclearMichael Gee2018-05-311-1/+1
|/ /
* | Remove errant debugger callGeorge Claghorn2018-05-301-1/+0
| |