| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \ \ \
| | | | |
| | | | | |
Remove backticks around proejct names
|
| | | | |
| | | | |
| | | | |
| | | | | |
[ci skip]
|
|\ \ \ \ \
| |/ / / /
|/| | | |
| | | | |
| | | | | |
dan-jensen/fix-eager-load-lockup-bug-in-development
Fix bug with eager_load in development environment
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Modifies the routes simulator to allow for empty RouteSets, which are
created when secondary Engines are loaded.
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | | |
Improve some DateAndTime calculations
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
DeepCover revealed that most of these `wday != 0 ? wday - 1 : 6`
were not entirely covered, i.e. the case of `wday == 0` was not tested:
https://deep-cover.github.io/rails-cover/activesupport/activesupport/lib/active_support/core_ext/date_and_time/calculations.rb.html#L351
There's actually no valid reason to consider Sunday a special case,
so this commit simply reajusts the values used for calculations.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Remove ineffective no-warnings flags from Contribute guide
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This is not working. [ci skip]
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Dev-Dep guide: mention AST third party requirements
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
[ci skip]
|
| |/ / / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Avoid the likes of:
```
Error:
ActiveStorage::RepresentationTest#test_representing_an_MP4_video:
Errno::ENOENT: No such file or directory - ffmpeg
test/models/representation_test.rb:27:in `block in <class:RepresentationTest>'
```
Also note additiona macOS requirements in ActiveStorage guide.
[ci skip]
|
| |_|_|/ / /
|/| | | | |
| | | | | |
| | | | | |
| | | | | | |
It mark the association as loaded and this can cause the object to be in
an stale state.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Remove redundant accessors in AC test stub
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
introduced in a0ea528b61.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This also mark the association as loaded given we changed it in memory
and avoid the next access to the reader to make a query to the databse.
|
|\ \ \ \ \ \ \
| |/ / / / / /
|/| | | | | |
| | | | | | | |
Use hash lookup for deleting existing associations from `target`
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
`Array#delete` searches for all occurrences in the `target` array. When performing `dependent: :destroy` in active_record/associations/collection_association, the loop becomes O(N^2). It is particularly slow when destroying large amount of associations (e.g. 10K records).
Either `Hash` or `Set` can optimize the loop to O(N). `Hash` is slightly faster in this simple usage.
```ruby
class Dummy; end
num = 10_000
test1a = num.times.map { Dummy.new }; nil
test1b = test1a.dup
test2a = num.times.map { Dummy.new }; nil
test2b = test2a.dup
Benchmark.ips do |x|
x.config(stats: :bootstrap, confidence: 95)
x.report("hash") do
hash = test1a.group_by { |r| r }
test1b.select! { |r| !hash[r] }
end
x.report("array") do
test2a.each { |r| test2b.delete(r) }
end
x.compare!
end
```
```
Calculating -------------------------------------
hash 11.000 i/100ms
array 1.000 i/100ms
-------------------------------------------------
hash 114.586 (±16.6%) i/s - 561.000
array 1.710k (±10.3%) i/s - 8.377k
Comparison:
array: 1710.4 i/s
hash: 114.6 i/s - 14.93x slower
```
|
|\ \ \ \ \ \ \
| |_|_|_|/ / /
|/| | | | | | |
Allow to override the full_message error format
|
| | | | | | | |
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Use Rack to generate query information under test
|
| | |_|/ / / /
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
`to_query` sorts parameters before encoding them. This causes a round
tripping issue as noted here:
https://github.com/rails/rails/issues/23997#issuecomment-328297933
https://github.com/rails/rails/issues/10529#issuecomment-328298109
https://github.com/rails/rails/pull/30558
Unfortunately, that method is being used to generate cache keys, so its
results need to be stable:
https://github.com/rails/rails/commit/10dec0e65e1f4d87f411b4361045eba86b121be9
However, the test harness is only using `to_query` to encode parameters
before sending them to the controller so the "cache key" usecase doesn't
apply here.
This commit adds a test that demonstrates the round trip problems and
changes the serialization strategy to use Rack for encoding the
parameters rather than `to_query`.
|
| |_|_|_|_|/
|/| | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
left_joins
This regression was caused by #30995 due to `Hash#fetch` won't invoke
default proc. Just revert the change since #30995 is completely fixed by
e9c1653.
Fixes #33048.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
[ci skip]
|
| |_|_|/ /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | | |
guides [ci skip]
Follow up of 3915a47.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Add/Remove `require`
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
`activesupport/test/logger_test.rb` requires `tmpdir`.
`activesupport/test/multibyte_test_helpers.rb` requires
`filutils`, `open-uri`, and `tmpdir`.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- `activesupport/multibyte_normalization_conformance_test.rb`
`fileutils`, `tmpdir`, and `open-uri` are unused since
c245ca30f248367e07d5d831195b12c93a1e3137,
c245ca30f248367e07d5d831195b12c93a1e3137, and
7d7c2d13ba896dd8b58fe91d2fe0c4fc588069ca in accordance.
- `activesupport/test/multibyte_conformance_test.rb`
`tmpdir`, and `open-uri` are unused since
c245ca30f248367e07d5d831195b12c93a1e3137, and
7d7c2d13ba896dd8b58fe91d2fe0c4fc588069ca in accordance.
Remove using of `fileutils` since
c245ca30f248367e07d5d831195b12c93a1e3137.
- `activesupport/test/multibyte_grapheme_break_conformance_test.rb`
`fileutils`, `tmpdir`, and `open-uri` are unused since
c245ca30f248367e07d5d831195b12c93a1e3137,
c245ca30f248367e07d5d831195b12c93a1e3137, and
7d7c2d13ba896dd8b58fe91d2fe0c4fc588069ca in accordance.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
If use Node.js v10.4.0, ujs's build will result in an error, so
temporarily fix the version to v10.3.0.
Ref: https://travis-ci.org/rails/rails/jobs/389960856
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Add `ActiveSupport::CompareWithRange` to API docs
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Since it is documented in the guides
http://edgeguides.rubyonrails.org/active_support_core_extensions.html#include-questionmark-and-cover-questionmark
we can add it to API docs http://edgeapi.rubyonrails.org too.
[ci skip]
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Refactor actioncable's tests
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
`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.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Remove extra `include ActiveSupport::Testing::MethodCallAssertions`
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
`railties/test/isolation/abstract_unit.rb`
Related to #33102
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | | |
It includes via `require "abstract_unit"`.
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | |
| | | | | | |
Action Cable owns database connection, not Active Record
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Before this commit, the database connection used in Action Cable's
PostgreSQL adapter was "owned" by `ActiveRecord::Base.connection_pool`.
This meant that if, for example, `#clear_reloadable_connections!` was called on the pool, Active
Record would "steal" the database connection from Action Cable, and
would cause all sorts of issues. This became evident during file
reloads; despite Action Cable trying its hardest to return its borrowed
database connection to Active Record via `@pubsub.shutdown`, Active Record calls
`#clear_reloadable_connections!` on the connection pool, and due to the order of callbacks, Active
Record's callback was being executed first. This meant that if you tried
to rerender a view after a file was reloaded, you would have to wait
through Active Record's timeout and such.
Now, Action Cable takes direct ownership of the database connection it
uses. It removes the connection from the pool to avoid the situation
described above. Action Cable also makes sure to call `#disconnect!` on
the connection when appropriate, to match the previous behavior of
Active Record.
[ Jon Moss & Matthew Draper]
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
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.
|