aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* `SetupAndTeardown` has few caveats that breaks libraries:Edouard CHIN2018-04-273-13/+11
| | | | | | | | | | | | | | | | | | - In #32472 I introduced a fix in order for all `after_teardown` method provided by libraries and Rails to run, even if the application's `teardown` method raised an error (That's the default minitest behavior). However this change wasn't enough and doesn't take in consideration the ancestors chain. If a library's module containing an `after_teardown` method get included after the `SetupAndTeardown` module (one example is the [ActiveRecord::TestFixtures module](https://github.com/rails/rails/blob/7d2400ab61c8e3ed95e14d03ba3844e8ba2e36e4/activerecord/lib/active_record/fixtures.rb#L855-L856), then the ancestors of the test class would look something like ```ruby class MyTest < ActiveSupport::TestCase end puts MyTest.ancestors # [MyTest, ActiveSupport::TestCase, ActiveRecord::TestFixtures, ActiveSupport::Testing::SetupAndTeardown] ``` Any class/module in the ancestors chain that are **before** the `ActiveSupport::Testing::SetupAndTeardown` will behave incorrectly: - Their `before_setup` method will get called **after** all regular setup method - Their `after_teardown` method won't even get called in case an exception is raised inside a regular's test `teardown` A simple reproduction script of the problem here https://gist.github.com/Edouard-chin/70705542a59a8593f619b02e1c0a188c - One solution to this problem is to have the `AS::SetupAndTeardown` module be the very first in the ancestors chain. By doing that we ensure that no `before_setup` / `after_teardown` get executed prior to running the teardown callbacks
* Don't try to destoy the given string via method argumentAkira Matsuda2018-04-271-1/+1
| | | | | | | 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
* Reduce String allocations when building Action View tagsAkira Matsuda2018-04-271-1/+2
| | | | | This method is called against each tag option for each tag, and creates an extra garbage String per each call
* Reduce extra object creations in TaggedLoggingAkira Matsuda2018-04-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | 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]}}
* Merge pull request #32725 from nikolai-b/rm_count_math_mixinRyuta Kamizono2018-04-261-2/+0
|\ | | | | Remove math module from count
| * Remove math module from countNikolai B2018-04-251-2/+0
| | | | | | | | Not required after https://github.com/rails/arel/pull/449
* | Merge pull request #32728 from ricardotk002/prevent-duplication-active-storageGeorge Claghorn2018-04-253-10/+4
|\ \ | | | | | | Prevent code duplication in ActiveStorage analyzers tests
| * | Move #extract_metadata_from to ActiveStorage's TestHelperRicardo Díaz2018-04-253-10/+4
|/ / | | | | | | | | | | 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.
* | Simplify URL generation for partial downloads from GCSGeorge Claghorn2018-04-251-1/+2
| |
* | Merge pull request #32721 from javan/ast-unminify-jsJavan Makhmali2018-04-256-1386/+1093
|\ \ | |/ |/| Unminify activestorage.js
| * Unminify activestorage.jsJavan Makhmali2018-04-256-1386/+1093
|/
* Merge pull request #32717 from tgturner/make-get-and-set-values-public-againRyuta Kamizono2018-04-253-4/+15
|\ | | | | Make get_value public again
| * `get_value` needs to be a public methodGraham Turner2018-04-253-4/+15
|/ | | | | | Adds test case for failing issue Moves set_value back to protected
* Merge pull request #32702 from bogdanvlviv/fix-description-for-31685Rafael França2018-04-251-2/+2
|\ | | | | Fix title for example of removing data from `session` [ci skip]
| * Fix title for example of removing data from `session` [ci skip]bogdanvlviv2018-04-231-2/+2
| | | | | | | | | | | | | | | | | | 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.
* | Add a helper method to check that gem does not exist in `Gemfile`yuuji.yaginuma2018-04-251-49/+26
| |
* | Merge pull request #32713 from utilum/max_ffi_versionRafael França2018-04-252-4/+6
|\ \ | | | | | | Fix segmentation fault in EventedFileUpdateChecker
| * | Fix segmentation fault in EventedFileUpdateCheckerutilum2018-04-242-4/+6
| | | | | | | | | | | | resolves #32705
* | | Merge pull request #32715 from vaidehijoshi/refactor-scanner-testRafael França2018-04-251-47/+50
|\ \ \ | | | | | | | | Break up Journey's scanner test
| * | | Break up Journey's scanner testvaidehijoshi2018-04-241-47/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* | | | Merge pull request #32716 from yahonda/arel_collectors_bindMatthew Draper2018-04-251-0/+1
|\ \ \ \ | | | | | | | | | | Address `NameError: uninitialized constant Arel::Collectors::Bind`
| * | | | Address `NameError: uninitialized constant Arel::Collectors::Bind`Yasuo Honda2018-04-251-0/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 pull request #32097 from matthewd/arelMatthew Draper2018-04-25145-4/+11379
|\ \ \ \ | | | | | | | | | | Merge Arel
| * | | | Arel: :nodoc: allMatthew Draper2018-02-2481-81/+81
| | | | |
| * | | | Arel: rubocop -aMatthew Draper2018-02-24143-3077/+3179
| | | | |
| * | | | Merge Arel into Active RecordMatthew Draper2018-02-24146-4/+11277
| |\ \ \ \
| | * \ \ \ Merge pull request #516 from yahonda/ruby250Rafael França2018-01-253-1/+6
| | |\ \ \ \ | | | | | | | | | | | | | | CI with Ruby 2.5.0
| | | * | | | BigDecimal.new is deprecated in Ruby 2.5Yasuo Honda2018-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refer https://github.com/ruby/bigdecimal/pull/86
| | | * | | | require 'date' to address for Ruby 2.5Yasuo Honda2018-01-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Address #517
| | | * | | | Use the latest RubyGems 2.7.4 or higherYasuo Honda2018-01-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refer https://github.com/rubygems/rubygems/issues/2123
| | | * | | | CI with Ruby 2.5.0Yasuo Honda2018-01-061-0/+1
| | |/ / / / | | | | | | | | | | | | | | | | | | https://www.ruby-lang.org/en/news/2017/12/25/ruby-2-5-0-released/
| | * | | | Merge pull request #481 from lautis/lateralAaron Patterson2017-12-286-1/+40
| | |\ \ \ \ | | | | | | | | | | | | | | Lateral expressions for PostgreSQL
| | | * | | | PostgreSQL lateral expressionsVille Lautanala2017-04-255-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | | * | | | Fix link to SQL-92 grammarVille Lautanala2017-04-251-1/+1
| | | | | | |
| | * | | | | Merge pull request #513 from itsNikolay/remove_unused_requiresAaron Patterson2017-12-2811-17/+1
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | Remove Unused `require`
| | | * | | | | Remove Unused `require`Nikolay Ponomarev2017-12-2711-17/+1
| | |/ / / / / | | | | | | | | | | | | | | | | | | | | | It looks like they are left from old design
| | * | | | | Merge pull request #512 from itsNikolay/reduce_ReduceAaron Patterson2017-12-275-39/+9
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | Reduce `Reduce`
| | | * | | | | Reduce `Reduce`Nikolay Ponomarev2017-12-275-39/+9
| | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove `Arel::Visitors::Reduce` because it almost completely duplicates `Arel::Visitors::Visitor`
| | * | | | | Merge pull request #449 from kbrock/expr_nodeMatthew Draper2017-12-0616-28/+40
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | Introduce Expression Node
| | | * | | | | Delete is not a NodeExpression, change parentKeenan Brock2017-12-051-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This requires a little cut and paste from the Binary node, but it is used in different parts of sql
| | | * | | | | Introduce NodeExpression as parent of scalar nodesKeenan Brock2017-12-0515-25/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SQL is very powerful. Many nodes can be used as a sub expression or query. grouping all of these possible nodes together
| | * | | | | | Merge pull request #511 from ecbrodie/patch-1Rafael França2017-12-051-1/+7
| | |\ \ \ \ \ \ | | | |/ / / / / | | |/| | | | | Explicitly mentions the #and operator
| | | * | | | | Explicitly mentions the #and operatorEvan Brodie2017-12-051-1/+7
| | |/ / / / /
| | * | | | | Prepare for 9.0.0Rafael Mendonça França2017-11-142-1/+7
| | | | | | |
| | * | | | | Merge pull request #501 from abelards/patch-1Rafael França2017-11-141-1/+4
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | Better titles
| | | * | | | | Update README.mdSylvain Abélard2017-10-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| | * | | | | | Merge pull request #502 from kddeisz/count-mathRafael França2017-10-312-0/+11
| | |\ \ \ \ \ \ | | | |/ / / / / | | |/| | | | | Allow count nodes to have math functions
| | | * | | | | Allow count nodes to have math functionsKevin Deisz2017-10-272-0/+11
| | |/ / / / /
| | * | | | | Merge pull request #500 from ↵Sean Griffin2017-10-062-1/+13
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | jcoleman/fix_incorrect_typecasting_of_raw_sql_strings Type-castable attributes should not try to cast SqlLiteral nodes
| | | * | | | | Type-castable attributes should not try to cast SqlLiteral nodesJames Coleman2017-09-292-1/+13
| | |/ / / / /