| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
`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.
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Refactor activestorage/test/models/attached_test.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| | |
This reverts commit 07c035e72dd2267c2a45a7ddd2450687d6329b5b, reversing
changes made to 7b33903d7f30027fe99e4632c5517f0c469b3424.
|
|\ \
| | |
| | | |
Refactor activestorage/test/models/attached_test.rb
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|\ \
| |/
|/| |
Fix example of `index_with`
|
|/
|
|
|
|
|
|
|
|
| |
- 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]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Follow up of #32952.
|
|\
| |
| | |
Fix force equality checking not to break the serialized attribute with Array
|
| |
| |
| |
| | |
Context: https://github.com/rails/rails/commit/43ef00e5d7a55ad79bc840276d33cb70f1f5dde5#commitcomment-29256140
|
|\ \
| |/
|/| |
Child joins should be aliased when merging relations
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
PERF: avoid allocating column names where possible
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| | |
| | | |
Migrations will raise an exception if there are multiple column defin…
|
| | |
| | |
| | |
| | | |
(same name).
|
|\ \ \
| | | |
| | | | |
Fix testing guide typo
|
| | |/
| |/| |
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
Correct default value of `unknown_asset_fallback`
[ci skip]
|
|/ / /
| | |
| | |
| | |
| | | |
`Rails.application.config.assets.unknown_asset_fallback` now defaults to `false` in an unmodified Rails application.
[ci skip]
|
| | |
| | |
| | |
| | | |
Should be done before `before_add` callbacks.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | | |
Since #32289, `Spellchecker.suggest` returns only one value, multiple
suggestions not output.
|
|/ /
| |
| |
| | |
Fixes #32806.
|
|\ \
| |/
|/|
| |
| | |
ybakos/guides/layouts_and_rendering_class_spelling_fix
Capitalize class name 'Product' in layouts and rendering guide.
|
| |
| |
| |
| |
| | |
In this context, the phrase 'product instance' refers to the Product class,
so capitalize it.
|
|\ \
| | |
| | | |
ActiveStorage reflection
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Add the ability to reflect on the attachments that have been defined using ActiveRecord::Reflection.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
ybakos/guides/active_storage_overview_example_syntax_fix
Remove 'Current.' prefix from example.
|
| | |/
| |/|
| | |
| | |
| | | |
The prior sentence is referring just to an existing user object, so
the sudden magical 'Current.' prefix doesn't make sense. Remove it.
|
|\ \ \
| | | |
| | | | |
CI against MariaDB 10.3
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- 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
```
|
|\ \ \
| |_|/
|/| | |
[skip ci] Add changelog about bumping minimum SQLite version to 3.8
|
|/ /
| |
| |
| | |
Related to #32923
|
|\ \
| | |
| | | |
Remove mocha from action cable
|
| | |
| | |
| | |
| | | |
Q.E.D.
|
| | | |
|
|/ / |
|
|\ \
| | |
| | | |
"brethen" is misspelled and could be clearer
|
|/ / |
|
| | |
|