aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add missing require for `String#to_d`yuuji.yaginuma2018-12-211-0/+1
|
* Merge pull request #34767 from y-yagi/fix_convert_string_to_bigdecimalYuji Yaginuma2018-12-211-5/+1
|\ | | | | Use BigDecimal provided methods to convert String to BigDecimal
| * Use BigDecimal provided methods to convert String to BigDecimalyuuji.yaginuma2018-12-211-5/+1
| | | | | | | | | | | | | | | | | | | | | | `String#to_d` does not raise an exception if an invalid value is specified. So can remove exception handling. ``` $ bundle exec ruby -v -rbigdecimal -rbigdecimal/util -e 'p "123,003".to_d' ruby 2.6.0dev (2018-12-21 trunk 66474) [x86_64-linux] 0.123e3 ```
* | Merge pull request #34742 from kamipo/row_format_dynamic_by_defaultRyuta Kamizono2018-12-213-7/+40
|\ \ | | | | | | MySQL: `ROW_FORMAT=DYNAMIC` create table option by default
| * | MySQL: `ROW_FORMAT=DYNAMIC` create table option by defaultRyuta Kamizono2018-12-193-7/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since MySQL 5.7.9, the `innodb_default_row_format` option defines the default row format for InnoDB tables. The default setting is `DYNAMIC`. The row format is required for indexing on `varchar(255)` with `utf8mb4` columns. As long as using MySQL 5.6, CI won't be passed even if MySQL server setting is properly configured the same as MySQL 5.7 (`innodb_file_per_table = 1`, `innodb_file_format = 'Barracuda'`, and `innodb_large_prefix = 1`) since InnoDB table is created as the row format `COMPACT` by default on MySQL 5.6, therefore indexing on string with `utf8mb4` columns aren't succeeded. Making `ROW_FORMAT=DYNAMIC` create table option by default for legacy MySQL version would mitigate the indexing issue on the user side, and it makes CI would be passed on MySQL 5.6 which is configured properly.
* | | Merge pull request #34764 from kamipo/avoid_redundant_beginRyuta Kamizono2018-12-2184-1392/+1116
|\ \ \ | | | | | | | | Enable `Style/RedundantBegin` cop to avoid newly adding redundant begin block
| * | | Enable `Style/RedundantBegin` cop to avoid newly adding redundant begin blockRyuta Kamizono2018-12-2184-1392/+1116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we sometimes find a redundant begin block in code review (e.g. https://github.com/rails/rails/pull/33604#discussion_r209784205). I'd like to enable `Style/RedundantBegin` cop to avoid that, since rescue/else/ensure are allowed inside do/end blocks in Ruby 2.5 (https://bugs.ruby-lang.org/issues/12906), so we'd probably meets with that situation than before.
* | | | Merge pull request #34769 from elebow/module-delegate-to-docstringRyuta Kamizono2018-12-211-1/+1
|\ \ \ \ | | | | | | | | | | Module.delegate rdoc update to clarify :to parameter [ci skip]
| * | | | Clarify the :to parameter of delegateEddie Lebow2018-12-201-1/+1
| | | | |
* | | | | Merge pull request #33822 from y-yagi/do_not_check_parents_dor_directoriesYuji Yaginuma2018-12-212-2/+50
|\ \ \ \ \ | |/ / / / |/| | | | Do no watch parent directory of `dirs`
| * | | | Do not add parent directory to file system monitoringyuuji.yaginuma2018-12-182-2/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `EventedFileUpdateChecker` will search the parent directory if the specified directory does not exist. Since `test/mailers/previews` is included in the watch target by default, if there is no test directory (e.g. using `rspec`), the Rails root directory will be included in the watch target. ``` $ rails new app $ cd app $ ./bin/rails r "p Rails.application.reloaders.last.send(:directories_to_watch).include?(Rails.root)" false $ rm -rf test $ ./bin/rails r "p Rails.application.reloaders.last.send(:directories_to_watch).include?(Rails.root)" true ``` This causes `node_modules` to be included in watch target. Adding parent directories to watch target may include unexpected directories. In order to avoid this, fixed that parents of nonexistent directories are not added to the watch targets, instead checking that the directory exists when checking changes. Related to #32700. [Matthew Draper & Yuji Yaginuma]
* | | | | Add test for `travel_to` with time zoneyuuji.yaginuma2018-12-211-0/+17
| |_|_|/ |/| | | | | | | | | | | This is a regression test for #34751.
* | | | Fix integer regex deprecation warnings for Ruby 2.6.0 (#34728)Vinicius Stock2018-12-212-1/+2
| | | | | | | | | | | | | | | | | | | | * Fix integer regex deprecation warnings for Ruby 2.6.0 * Define =~ in FakeZone to avoid warnings from Ruby 2.6.0
* | | | Merge pull request #34762 from bogdanvlviv/fix-a-few-deprecation-warningsKasper Timm Hansen2018-12-205-51/+10
|\ \ \ \ | |_|/ / |/| | | Follow up #34754
| * | | Follow up #34754bogdanvlviv2018-12-205-51/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix a few deprecation warnings - Remove testing of `Hash#slice` - Imporve test of `Hash#slice!` - Remove mention about `Hash#slice` from the guide
* | | | Module#{attr,attr_accessor,attr_reader,attr_writer} become public since Ruby 2.5Ryuta Kamizono2018-12-218-12/+12
| | | | | | | | | | | | | | | | https://bugs.ruby-lang.org/issues/14132
* | | | Module#{define_method,alias_method,undef_method,remove_method} become public ↵Ryuta Kamizono2018-12-2122-43/+43
|/ / / | | | | | | | | | | | | | | | since Ruby 2.5 https://bugs.ruby-lang.org/issues/14133
* | | Remove remaining tests for `Hash#transform_keys` and `Hash#transform_keys!`Ryuta Kamizono2018-12-211-27/+0
| | | | | | | | | | | | Follow up #34761.
* | | Merge pull request #34761 from kamipo/require-ruby-2.5Ryuta Kamizono2018-12-2111-181/+6
|\ \ \ | | | | | | | | Use native `Array#append`, `Array#prepend`, `Hash#transform_keys`, and `Hash#transform_keys!`
| * | | Use native `Array#append`, `Array#prepend`, `Hash#transform_keys`, and ↵Ryuta Kamizono2018-12-2011-181/+6
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | `Hash#transform_keys!` Since Rails 6 requires Ruby 2.5. https://github.com/ruby/ruby/blob/ruby_2_5/NEWS Follow up #34754.
* | | Merge pull request #30973 from k0kubun/prefer-block-parameterRyuta Kamizono2018-12-202-20/+4
|\ \ \ | | | | | | | | Unify _read_attribute definition to use &block
| * | | Unify _read_attribute definition to use &blockTakashi Kokubun2018-12-202-20/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks to ko1, passing block parameter to another method is significantly optimized in Ruby 2.5. https://bugs.ruby-lang.org/issues/14045 Thus we no longer need to keep this ugly hack.
* | | | fix tests for mail 2.8pavel2018-12-191-4/+4
| | | |
* | | | Merge pull request #34754 from rails/require-ruby-2.5Kasper Timm Hansen2018-12-1929-106/+45
|\ \ \ \ | | | | | | | | | | Require Ruby 2.5 for Rails 6.
| * | | | Require Ruby 2.5 for Rails 6.Kasper Timm Hansen2018-12-1929-106/+45
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generally followed the pattern for https://github.com/rails/rails/pull/32034 * Removes needless CI configs for 2.4 * Targets 2.5 in rubocop * Updates existing CHANGELOG entries for fewer merge conflicts * Removes Hash#slice extension as that's inlined on Ruby 2.5. * Removes the need for send on define_method in MethodCallAssertions.
* | | | Clarify implicit meaning of 'workers: 2' in parallelization tests.Kasper Timm Hansen2018-12-191-6/+8
| | | |
* | | | Pass the correct value as JSONyuuji.yaginuma2018-12-191-1/+1
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This takes away the following log. ``` Error occurred while parsing request parameters. Contents: {:foo=>"heyo"} ``` Pass the correct value as JSON
* | | Use `utf8mb4` charset for internal tables if the row format `DYNAMIC` by defaultRyuta Kamizono2018-12-192-10/+10
| | | | | | | | | | | | The indexing issue on `utf8mb4` columns is resolved since MySQL 5.7.9.
* | | Merge pull request #34739 from sambostock/correct-nested-config-documentationKasper Timm Hansen2018-12-181-1/+1
|\ \ \ | | | | | | | | Single nest config in configuration guides
| * | | Single nest config in configuration guidesSam Bostock2018-12-181-1/+1
|/ / / | | | | | | | | | | | | | | | | | | Double nesting of configuration is not supported (without using an intermediate object), even though the docs suggest it is. [ci-skip]
* | | Eliminate "warning: assigned but unused variable - testEof"Ryuta Kamizono2018-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/ammar/regexp_parser/pull/57 ``` % be ruby -w -Itest test/controller/filters_test.rb /Users/kamipo/src/github.com/rails/rails/vendor/bundle/ruby/2.5.0/gems/addressable-2.5.2/lib/addressable/idna/pure.rb:154: warning: assigned but unused variable - startercc /Users/kamipo/src/github.com/rails/rails/vendor/bundle/ruby/2.5.0/gems/regexp_parser-1.2.0/lib/regexp_parser/scanner.rb:1146: warning: assigned but unused variable - testEof Run options: --seed 32647 # Running: ................................................... Finished in 0.291176s, 175.1518 runs/s, 343.4349 assertions/s. 51 runs, 100 assertions, 0 failures, 0 errors, 0 skips ```
* | | [ci skip] Remove needless changelog entry, as bug fix was backported to 5.2.Kasper Timm Hansen2018-12-181-4/+0
| | |
* | | Merge pull request #34737 from r7kamura/feature/test-case-params-nilKasper Timm Hansen2018-12-183-2/+18
|\ \ \ | | | | | | | | Allow nil params on controller HTTP test methods
| * | | Allow nil params on controller HTTP test methodsr7kamura2018-12-183-2/+18
| | | |
* | | | More exercise `test_running_prepended_before_and_after_action`Ryuta Kamizono2018-12-191-1/+3
| | | | | | | | | | | | | | | | | | | | Just testing that `after_action` is invoked before `prepend_after_action`.
* | | | Add option to set parallel test worker count to the physical core count of ↵Bogdan2018-12-184-13/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the machine (#34735) * Add option to set parallel test worker count to the physical core count of the machine Also, use the physical core count of the machine as the default number of workers, and generate the `test_helper.rb` file with `parallelize(workers: :number_of_processors)` Closes #34734 * Ensure that we always test parallel testing Since #34734 we decided to use the physical core count of the machine as the default number of workers in the parallel testing, we need to ensure that some tests use at least 2 workers because we could run those tests on VM that has only 1 physical core. It also fixes tests failures on the CI since Travis server we are using has only one physical core. See https://travis-ci.org/rails/rails/jobs/469281088#L2352
* | | | Merge pull request #34635 from WoH/data-disable-foreverJavan Makhmali2018-12-183-0/+29
|\ \ \ \ | |/ / / |/| | | UJS: Do not disable previously disabled elements
| * | | Do not disable previously disabled elementsWoH2018-12-063-0/+29
| | | |
* | | | Add test case for ce48b5a366482d4b4c4c053e1e39e79d71987197Ryuta Kamizono2018-12-181-0/+7
| | | |
* | | | Fix `View.new` method call with arguments syntaxRyuta Kamizono2018-12-181-1/+1
| | | | | | | | | | | | [ci skip]
* | | | Merge pull request #34733 from tjschuck/view_context_doc_formattingVipul A M2018-12-181-4/+5
|\ \ \ \ | | | | | | | | | | Fix doc formatting [ci skip]
| * | | | Fix doc formattingT.J. Schuck2018-12-171-4/+5
|/ / / / | | | | | | | | | | | | [ci skip]
* | | | Merge pull request #33145 from gsamokovarov/host-authorizationEileen M. Uchitelle2018-12-1715-50/+393
|\ \ \ \ | | | | | | | | | | Guard against DNS rebinding attacks by whitelisting hosts
| * \ \ \ Merge branch 'master' into host-authorizationEileen M. Uchitelle2018-12-176-9/+59
| |\ \ \ \ | |/ / / / |/| | | |
* | | | | Merge pull request #34717 from tbuehlmann/controller-test-parsed-bodyKasper Timm Hansen2018-12-173-6/+37
|\ \ \ \ \ | | | | | | | | | | | | Allow using parsed_body in ActionController::TestCase
| * | | | | Allow using parsed_body in ActionController::TestCaseTobias Bühlmann2018-12-163-6/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | … by switching the initialzation of an appropriate response parser in `ActionDispatch::TestResponse` from eagerly to lazily. By doing so, the response parser can be correctly set for `ActionController::TestCase`, which doesn't include the content type header in the constructor but only sets it at a later time. Fixes #34676.
* | | | | | Extend documentation of `ActiveSupport::Notifications.subscribe` (#34721)Bogdan2018-12-173-3/+22
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Extend documentation of `ActiveSupport::Notifications.subscribe` Add mention that a block with only one argument passed to the method will yield an event object. Related to #33451 * Emphasize that `SubscribeEventObjects` is a test class by adding suffix `Test`
| * / / / Introduce a guard against DNS rebinding attacksGenadi Samokovarov2018-12-1515-50/+393
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ActionDispatch::HostAuthorization is a new middleware that prevent against DNS rebinding and other Host header attacks. By default it is included only in the development environment with the following configuration: Rails.application.config.hosts = [ IPAddr.new("0.0.0.0/0"), # All IPv4 addresses. IPAddr.new("::/0"), # All IPv6 addresses. "localhost" # The localhost reserved domain. ] In other environments, `Rails.application.config.hosts` is empty and no Host header checks will be done. If you want to guard against header attacks on production, you have to manually permit the allowed hosts with: Rails.application.config.hosts << "product.com" The host of a request is checked against the hosts entries with the case operator (#===), which lets hosts support entries of type RegExp, Proc and IPAddr to name a few. Here is an example with a regexp. # Allow requests from subdomains like `www.product.com` and # `beta1.product.com`. Rails.application.config.hosts << /.*\.product\.com/ A special case is supported that allows you to permit all sub-domains: # Allow requests from subdomains like `www.product.com` and # `beta1.product.com`. Rails.application.config.hosts << ".product.com"
* | | / Prevent infinit method_missing loop on attribute methodsRyuta Kamizono2018-12-151-0/+1
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a klass has acceptance validation and then `klass.undefine_attribute_methods` is happened before an attribute method is called, infinit loop is caused on the `method_missing` defined by the `LazilyDefineAttributes`. https://travis-ci.org/rails/rails/jobs/467053984#L1409 To prevent the infinit loop, the `method_missing` should ensure `klass.define_attribute_methods`.
* | | Ruby can show a little bit more detailed info in shorter codeAkira Matsuda2018-12-151-1/+1
| | | | | | | | | | | | This follows up adb0c7bc5116e0f6020a4ec32b7e19ea8b26f1ec