| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Caused at 9276ea89d2b0be9fdd1ad6590857f8d45a38c267.
|
| |_|/ / / /
|/| | | | |
| | | | | |
| | | | | | |
This method would be called so many times and would create so many temporary garbage Strings
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Or it would raise if the argument was frozen.
And even with this change, it would still reduce String allocations together with 9276ea89d2b0be9fdd1ad6590857f8d45a38c267
because `escape` should be `true` in most cases
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This method is called against each tag option for each tag,
and creates an extra garbage String per each call
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
tags_text method creates 3 Ruby objects per each logger call when no custom tags are given
(which is the default setting, and so presumably the majority use case).
This patch reduces two temporary object creations in this case.
require 'allocation_tracer'
ObjectSpace::AllocationTracer.setup(%i{type})
tags = ['a']
pp before: ObjectSpace::AllocationTracer.trace {
tags.collect { |tag| "[#{tag}] " }.join
}
pp after: ObjectSpace::AllocationTracer.trace {
"[#{tags[0]}] "
}
{:before=>{[:T_ARRAY]=>[1, 0, 0, 0, 0, 0], [:T_STRING]=>[2, 0, 0, 0, 0, 0]}}
{:after=>{[:T_STRING]=>[1, 0, 0, 0, 0, 0]}}
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
Remove math module from count
|
| | | | |
| | | | |
| | | | |
| | | | | |
Not required after https://github.com/rails/arel/pull/449
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Prevent code duplication in ActiveStorage analyzers tests
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
ImageAnalyzerTest and VideoAnalyzerTest are defining the same helper,
since both use `#create_file_blob` that is defined in TestHelper, it
makes sense to move `#extract_metadata_from` to that side.
|
| | | | | |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Unminify activestorage.js
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
Make get_value public again
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | | |
Adds test case for failing issue
Moves set_value back to protected
|
|\ \ \ \
| | | | |
| | | | | |
Fix title for example of removing data from `session` [ci skip]
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
After #31685 the description says different what
we expect to see in the example. Change `assign that key to be nil` to
`or delete the key/value pair` in order to highlight what is shown in the example.
Fix one more example of removing data from the session in favour of using
`delete` since assigning to `nil` doesn't delete key from it.
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Fix segmentation fault in EventedFileUpdateChecker
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
resolves #32705
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Break up Journey's scanner test
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This breaks up the one megatest for Journey's scanner into multiple test
cases, which also provides better output when there is a failure in the
scanner.
Before:
```
./bin/test test/journey/route/definition/scanner_test.rb
Run options: --seed 778
F
Failure:
ActionDispatch::Journey::Definition::TestScanner#test_tokens [/Users/vaidehijoshi/Code/tilde/rails/actionpack/test/journey/route/definition/scanner_test.rb:57]:
--- expected
+++ actual
@@ -1 +1 @@
-[[:SLASH, "/"], [:LITERAL, "page!!"]]
+[[:SLASH, "/"], [:LITERAL, "page!"]]
bin/test Users/vaidehijoshi/Code/tilde/rails/actionpack/test/journey/route/definition/scanner_test.rb:14
Finished in 0.090899s, 11.0012 runs/s, 44.0049 assertions/s.
1 runs, 4 assertions, 1 failures, 0 errors, 0 skips
```
After:
```
./bin/test test/journey/route/definition/scanner_test.rb
Run options: --seed 2230
....................F
Failure:
ActionDispatch::Journey::Definition::TestScanner#test_scanning_/page$ [/Users/vaidehijoshi/Code/tilde/rails/actionpack/test/journey/route/definition/scanner_test.rb:58]:
Wrong tokens for `/page$`.
--- expected
+++ actual
@@ -1 +1 @@
-[[:SLASH, "/"], [:LITERAL, "page$$"]]
+[[:SLASH, "/"], [:LITERAL, "page$"]]
bin/test Users/vaidehijoshi/Code/tilde/rails/actionpack/test/journey/route/definition/scanner_test.rb:56
F
Failure:
ActionDispatch::Journey::Definition::TestScanner#test_scanning_/page! [/Users/vaidehijoshi/Code/tilde/rails/actionpack/test/journey/route/definition/scanner_test.rb:58]:
Wrong tokens for `/page!`.
--- expected
+++ actual
@@ -1 +1 @@
-[[:SLASH, "/"], [:LITERAL, "page!!"]]
+[[:SLASH, "/"], [:LITERAL, "page!"]]
bin/test Users/vaidehijoshi/Code/tilde/rails/actionpack/test/journey/route/definition/scanner_test.rb:56
F
Failure:
ActionDispatch::Journey::Definition::TestScanner#test_scanning_/page& [/Users/vaidehijoshi/Code/tilde/rails/actionpack/test/journey/route/definition/scanner_test.rb:58]:
Wrong tokens for `/page&`.
--- expected
+++ actual
@@ -1 +1 @@
-[[:SLASH, "/"], [:LITERAL, "page&&"]]
+[[:SLASH, "/"], [:LITERAL, "page&"]]
bin/test Users/vaidehijoshi/Code/tilde/rails/actionpack/test/journey/route/definition/scanner_test.rb:56
Finished in 0.126447s, 181.8944 runs/s, 181.8944 assertions/s.
23 runs, 23 assertions, 3 failures, 0 errors, 0 skips
```
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Address `NameError: uninitialized constant Arel::Collectors::Bind`
|
|/ / / / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
when tested with Ruby 2.5 or higher
```ruby
$ ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
$ bundle exec ruby -w -Itest test/cases/arel/collectors/bind_test.rb -n test_compile_gathers_all_bind_params
Run options: -n test_compile_gathers_all_bind_params --seed 24420
E
Error:
Arel::Collectors::TestBind#test_compile_gathers_all_bind_params:
NameError: uninitialized constant Arel::Collectors::Bind
Did you mean? Binding
test/cases/arel/collectors/bind_test.rb:15:in `collect'
test/cases/arel/collectors/bind_test.rb:19:in `compile'
test/cases/arel/collectors/bind_test.rb:31:in `test_compile_gathers_all_bind_params'
bin/rails test test/cases/arel/collectors/bind_test.rb:30
Finished in 0.002343s, 426.8559 runs/s, 0.0000 assertions/s.
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
$
```
It is likely due to Ruby 2.5 does not look up top level constant.
https://www.ruby-lang.org/en/news/2017/12/25/ruby-2-5-0-released/
"Top-level constant look-up is no longer available."
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Merge Arel
|
| | | | | | | | |
|
| | | | | | | | |
|
| |\ \ \ \ \ \ \ |
|
| | |\ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
CI with Ruby 2.5.0
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Refer https://github.com/ruby/bigdecimal/pull/86
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Address #517
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Refer https://github.com/rubygems/rubygems/issues/2123
|
| | |/ / / / / / /
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
https://www.ruby-lang.org/en/news/2017/12/25/ruby-2-5-0-released/
|
| | |\ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Lateral expressions for PostgreSQL
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Support for PostgreSQL lateral expressions. This is treated as an unary
function applied to a query expression.
Lateral is a separate function to provide interoperability with aliases
and unions. These are also separate node types that wrap
SelectStatements. The lateral option would need to be implemented in
these nodes separately if lateral was an option of SelectStatement.
When building the query, an alias can be given as an argument. This
enables building a lateral query with an table alias without using
either Nodes::TableAlias or Nodes::Lateral directly.
|
| | | | | | | | | | |
|
| | |\ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Remove Unused `require`
|
| | |/ / / / / / / /
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
It looks like they are left from old design
|
| | |\ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Reduce `Reduce`
|
| | |/ / / / / / / /
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Remove `Arel::Visitors::Reduce` because it almost completely duplicates
`Arel::Visitors::Visitor`
|
| | |\ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Introduce Expression Node
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
This requires a little cut and paste from the Binary node, but it is
used in different parts of sql
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
SQL is very powerful. Many nodes can be used as a sub expression or
query. grouping all of these possible nodes together
|
| | |\ \ \ \ \ \ \ \ \
| | | |/ / / / / / / /
| | |/| | | | | | | | |
Explicitly mentions the #and operator
|
| | |/ / / / / / / / |
|
| | | | | | | | | | |
|
| | |\ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Better titles
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
* s/crazy/advanced/ to avoid ableist words
* last sections didn't have titles to separate topics
I have written a bit more examples of "less trivial" Arel code here, perhaps we can add some of that here:
https://github.com/rstacruz/cheatsheets/pull/92/files
|
| | |\ \ \ \ \ \ \ \ \
| | | |/ / / / / / / /
| | |/| | | | | | | | |
Allow count nodes to have math functions
|
| | |/ / / / / / / / |
|
| | |\ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
jcoleman/fix_incorrect_typecasting_of_raw_sql_strings
Type-castable attributes should not try to cast SqlLiteral nodes
|