aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Ensure `apply_join_dependency` for subqueries in `from` and `where`Ryuta Kamizono2017-11-103-0/+19
| | | | Fixes #21577.
* :scissors:Ryuta Kamizono2017-11-101-2/+2
| | | | [ci skip]
* Adjust blank linesRyuta Kamizono2017-11-104-4/+5
|
* Merge pull request #31065 from bogdan/cleanup-cache-keyAndrew White2017-11-101-26/+11
|\ | | | | Remove code duplication in ActiveSupport::Cache
| * Remove code duplication in ActiveSupport::CacheBogdan Gusiev2017-11-091-26/+11
| |
* | Merge pull request #31119 from y-yagi/add_missing_requiresRyuta Kamizono2017-11-101-0/+1
|\ \ | | | | | | Add missing requires
| * | Add missing requiresyuuji.yaginuma2017-11-101-0/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, executing the test with only `attribute_test.rb` results in an error. ``` ./bin/test -w test/cases/attribute_test.rb Run options: --seed 41205 # Running: ....E Error: ActiveModel::AttributeTest#test_attributes_do_not_equal_attributes_with_different_types: NameError: uninitialized constant ActiveModel::AttributeTest::Type rails/activemodel/test/cases/attribute_test.rb:159:in `block in <class:AttributeTest>' bin/test test/cases/attribute_test.rb:158 ``` Added a missing require to fix this.
* | Remove useless preloader classesRyuta Kamizono2017-11-1010-104/+15
| | | | | | | | | | | | | | | | | | They are only different by one line of code which doesn't deserve a hierarchy of 7 classes. Closes #31079. [Ryuta Kamizono & Bogdan Gusiev]
* | Merge pull request #31118 from aycabta/fix-rdoc-urlAkira Matsuda2017-11-102-4/+4
|\ \ | | | | | | Fix RDoc and Rake URL
| * | Use new Rake URL of Ruby core [ci skip]aycabta2017-11-101-1/+1
| | |
| * | Use new RDoc URL of Ruby core [ci skip]aycabta2017-11-101-3/+3
|/ /
* | Merge pull request #31114 from y-yagi/fix_ruby_warnings_in_active_modelRyuta Kamizono2017-11-102-3/+3
|\ \ | | | | | | Fix ruby warnings in Active Model
| * | Fix "warning: assigned but unused variable - name"yuuji.yaginuma2017-11-101-1/+1
| | |
| * | Fix "warning: instance variable @attributes not initialized"yuuji.yaginuma2017-11-101-2/+2
| | |
* | | Merge pull request #31113 from ↵Ryuta Kamizono2017-11-102-2/+2
|\ \ \ | | | | | | | | | | | | | | | | y-yagi/use_e_option_to_specify_environment_in_console_command Use `-e` option to specify the environment in console command [ci skip]
| * | | Use `-e` option to specify the environment in console command [ci skip]yuuji.yaginuma2017-11-102-2/+2
| |/ / | | | | | | | | | | | | Passing the environment's name as a regular argument is deprecated in 48b249927375465a7102acc71c2dfb8d49af8309.
* | | Merge pull request #31115 from y-yagi/add_missing_requiresRyuta Kamizono2017-11-102-0/+4
|\ \ \ | | | | | | | | Add missing requires
| * | | Add missing requiresyuuji.yaginuma2017-11-102-0/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, executing the test with only `attribute_set_test.rb` results in an error. ``` ./bin/test -w test/cases/attribute_set_test.rb Run options: --seed 33470 # Running: E Error: ActiveModel::AttributeSetTest#test_#map_returns_a_new_attribute_set_with_the_changes_applied: NameError: uninitialized constant ActiveModel::AttributeSetTest::AttributeSet Did you mean? ActiveModel::Attributes ActiveModel::Attribute activemodel/test/cases/attribute_set_test.rb:235:in `block in <class:AttributeSetTest>' bin/test test/cases/attribute_set_test.rb:234 ``` Added a missing require to fix this. Also, I suspect that this is the cause of failures in CI. Ref: https://travis-ci.org/rails/rails/jobs/299994708
* | | Merge pull request #31116 from y-yagi/remove_unused_requireRyuta Kamizono2017-11-101-1/+0
|\ \ \ | |/ / |/| | Remove unused require
| * | Remove unused requireyuuji.yaginuma2017-11-101-1/+0
|/ / | | | | | | This is no longer used since fd6aaaa.
* | Merge pull request #31111 from koic/bump_rubocop_to_0_51_0Guillermo Iguaran2017-11-094-4/+4
|\ \ | | | | | | Bump RuboCop to 0.51.0
| * | Bump RuboCop to 0.51.0Koichi ITO2017-11-104-4/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ## Summary RuboCop 0.51.0 was released. https://github.com/bbatsov/rubocop/releases/tag/v0.51.0 And rubocop-0-51 channel is available in Code Climate. https://github.com/codeclimate/codeclimate-rubocop/issues/109 This PR will bump RuboCop to 0.51.0 and fixes the following new offenses. ```console % bundle exec rubocop Inspecting 2358 files (snip) Offenses: actionpack/lib/action_controller/metal/http_authentication.rb:251:59: C: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. [key.strip, value.to_s.gsub(/^"|"$/, "").delete('\'')] ^^^^ activesupport/test/core_ext/load_error_test.rb:8:39: C: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. assert_raise(LoadError) { require 'no_this_file_don\'t_exist' } ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2358 files inspected, 2 offenses detected ```
* | Merge pull request #31027 from PHedkvist/inflector_test_typeRafael França2017-11-092-2/+2
|\ \ | | | | | | Fixed typo in test for activesupport parameterize
| * | Fixed typo in test for activesupport parameterizePierre Hedkvist2017-11-012-2/+2
| | |
* | | Merge pull request #30414 from bogdanvlviv/clear-mysql_database_tasksRafael França2017-11-093-139/+5
|\ \ \ | | | | | | | | Simplify implementation of `MySQLDatabaseTasks`
| * | | Simplify implementation of `MySQLDatabaseTasks`bogdanvlviv2017-10-303-135/+3
| | | | | | | | | | | | | | | | | | | | | | | | Don't process MySQL ERROR 1045, raise error instead Make behavior of `MySQLDatabaseTasks` more consistent with behavior of `PostgreSQLDatabaseTasks`
| * | | Raise error if unsupported charset for mysqlbogdanvlviv2017-10-302-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `blog$ bin/rails db:create` Before: ``` Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf42", "pool"=>5, "username"=>"root", "password"=>nil, "socket"=>"/var/run/mysqld/mysqld.sock", "database"=>"blog_development"}, {:charset=>"utf42"} (If you set the charset manually, make sure you have a matching collation) Created database 'blog_development' Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf42", "pool"=>5, "username"=>"root", "password"=>nil, "socket"=>"/var/run/mysqld/mysqld.sock", "database"=>"blog_test"}, {:charset=>"utf42"} (If you set the charset manually, make sure you have a matching collation) Created database 'blog_test' ``` After: ``` Unsupported charset: '"utf42"' Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf42", "pool"=>5, "username"=>"root", "password"=>nil, "socket"=>"/var/run/mysqld/mysqld.sock", "database"=>"blog_development"} rails aborted! Mysql2::Error: Unsupported charset: '"utf42"' ... (stack trace) ... bin/rails:4:in `<main>' Tasks: TOP => db:create (See full trace by running task with --trace) ``` Closes #29683 Related to #27398
* | | | Merge pull request #25346 from bogdan/correct-tags-count-in-fixturesRafael França2017-11-095-11/+20
|\ \ \ \ | | | | | | | | | | Set counter caches to correct values in fixtures
| * | | | Set counter caches to correct values in fixturesBogdan Gusiev2017-11-085-11/+20
| | | | |
* | | | | Merge pull request #30985 from lugray/attribute_set_in_amRafael França2017-11-0922-236/+225
|\ \ \ \ \ | | | | | | | | | | | | Move Attribute and AttributeSet to ActiveModel
| * | | | | Move Attribute and AttributeSet to ActiveModelLisa Ugray2017-11-0922-236/+225
|/ / / / / | | | | | | | | | | | | | | | | | | | | Use these to back the attributes API. Stop automatically including ActiveModel::Dirty in ActiveModel::Attributes, and make it optional.
* | | | | Merge pull request #31088 from neumayr/am-helper-missing-field_with_errorsRafael França2017-11-094-3/+104
|\ \ \ \ \ | | | | | | | | | | | | field_error_proc wrap form select optgroup and separator option
| * | | | | Fix field_error_proc wrap form select optgroup and divider option tagneumayr2017-11-094-3/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ### Summary The [`:field_error_proc`](https://github.com/rails/rails/blob/master/actionview/lib/action_view/base.rb#L145) is responsible for decorating input tags that refer to attributes with errors. This default build-in rails feature wrap invalid form elements with additional markup: `<div class="field_with_errors">[…]</div>`. * Fix for `field_error_proc` wraps form select `optgroup` * Fix for `field_error_proc` wraps form select divider `option` * Add tests for uncovered elements with errors [Fixes #31088] #### Test coverage * `test_select_grouped_options_with_errors` * `test_time_zone_select_with_priority_zones_and_errors` #### Extend test coverage * `test_collection_select_with_errors` * `test_label_with_errors` * `test_check_box_with_errors` * `test_check_boxes_with_errors` * `test_radio_button_with_errors` * `test_radio_buttons_with_errors` * `test_collection_check_boxes_with_errors` * `test_collection_radio_buttons_with_errors`
* | | | | | Merge pull request #31099 from nobu/patch-1Rafael Mendonça França2017-11-091-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Use `Tempfile.create`
| * | | | | | Use `Dir.mktmpdir`Nobuyoshi Nakada2017-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As `@cache_path` is expected to be a directory name, use `Dir.mktmpdir`. And omit unnecessary `Dir.tmpdir`.
| * | | | | | Use `Tempfile.create`Nobuyoshi Nakada2017-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | Instead of `Dir::Tmpname.make_tmpname`, an internal method which does not guarantee uniqueness, use `Tempfile.create`.
* | | | | | | Merge pull request #31081 from rails/allow-include-time-with-zone-rangeAndrew White2017-11-095-4/+46
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Allow `Range#include?` on TWZ ranges
| * | | | | | | Allow `Range#include?` on TWZ rangesAndrew White2017-11-085-4/+46
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In #11474 we prevented TWZ ranges being iterated over which matched Ruby's handling of Time ranges and as a consequence `include?` stopped working with both Time ranges and TWZ ranges. However in ruby/ruby@b061634 support was added for `include?` to use `cover?` for 'linear' objects. Since we have no way of making Ruby consider TWZ instances as 'linear' we have to override `Range#include?`. Fixes #30799.
* | | | | | | Merge pull request #31102 from y-yagi/do_not_show_credentials_in_generators_helpEileen M. Uchitelle2017-11-092-1/+3
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | Do not show credentials in generators help
| * | | | | | Do not show credentials in generators helpyuuji.yaginuma2017-11-092-1/+3
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since credentials generator is executed via the credentials command and does not need to be executed directly, so it is not necessary to show it in help.
* | | | | | Should pass `test_no_locks_no_wait` not only on `PostgreSQLAdapter` and ↵Ryuta Kamizono2017-11-091-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | `OracleAdapter`
* | | | | | Merge pull request #31077 from gsamokovarov/assert-changes-nilRafael França2017-11-092-9/+5
|\ \ \ \ \ \ | | | | | | | | | | | | | | Use plain assert in assert_changes to avoid MT6 refutes
| * | | | | | Use plain assert in assert_changes to avoid MT6 refutesGenadi Samokovarov2017-11-072-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seeing the previously issued PRs about it, we can avoid the `nil` comparisons that can happen in `assert_changes` by using plain `assert` calls. This is to avoid a deprecation warning about comparing `nil` values in `assert_equal` for Minitest 5 and a crash in Minitest 6. You can see the preparations done in [`assert_equal`][ae]. You can also see that [`assert`][a] does not care about `nil`s. [ae]: https://github.com/seattlerb/minitest/blob/ca6a71ca901016db09a5ad466b4adea4b52a504a/lib/minitest/assertions.rb#L159-L188 [a]: https://github.com/seattlerb/minitest/blob/ca6a71ca901016db09a5ad466b4adea4b52a504a/lib/minitest/assertions.rb#L131-L142
* | | | | | | Merge pull request #31078 from aeroastro/feature/fix-typoRafael França2017-11-091-2/+2
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix typoes on ActionDispatch::HTTP::FilterParameters
| * | | | | | | Fix typo on ActionDispatc::HTTP::FilterParametersTakumasa Ochi2017-11-071-2/+2
| | | | | | | |
* | | | | | | | Merge pull request #31095 from y-yagi/correctly_kill_the_server_in_ujs_testRafael França2017-11-081-2/+2
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Correctly kill the server started with ujs test
| * | | | | | | | Correctly kill the server started with ujs testyuuji.yaginuma2017-11-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `Kernel.#spawn` execute command via the shell if contains shell metacharacters in the command. In that case, return value of `spawn` is pid of the shell, not the server. Therefore, just killing the pid will leave the process of server. In order to correctly kill the server, send a signal to the process group, not the process.
* | | | | | | | | Merge pull request #31091 from yahonda/concurrent_transaction_test_conditionsRafael França2017-11-081-15/+13
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Allow `ConcurrentTransactionTest` can run with Oracle enhanced adapter
| * | | | | | | | | Run `ConcurrentTransactionTest` if `supports_transaction_isolation?`Yasuo Honda2017-11-081-15/+13
| |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | returns true Not only postgresql or mysql2 adapter, Oracle enhanced adapter whose default isolation level is read commited, passes these two test cases. `ConcurrentTransactionTest#test_transaction_per_thread` `ConcurrentTransactionTest#test_transaction_isolation__read_committed` ```ruby $ ARCONN=oracle bin/test test/cases/transactions_test.rb:961 -v Using oracle Run options: -v --seed 18865 ConcurrentTransactionTest#test_transaction_per_thread = 0.98 s = . Finished in 1.061036s, 0.9425 runs/s, 5.6549 assertions/s. 1 runs, 6 assertions, 0 failures, 0 errors, 0 skips ``` ```ruby $ ARCONN=oracle bin/test test/cases/transactions_test.rb:979 -v Using oracle Run options: -v --seed 13341 ConcurrentTransactionTest#test_transaction_isolation__read_committed = 1.85 s = . Finished in 1.928637s, 0.5185 runs/s, 10.3700 assertions/s. 1 runs, 20 assertions, 0 failures, 0 errors, 0 skips $ ``` Also, regardless it is a file based or memory based these tests could fail with SQLite3Adapter. (Extra CR added to make lines shorter) ```ruby $ ARCONN=sqlite3 bin/test test/cases/transactions_test.rb:961 -v Using sqlite3 Run options: -v --seed 18815 ConcurrentTransactionTest#test_transaction_per_thread = /home/yahonda/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sqlite3-1.3.13/lib/sqlite3/statement.rb:108:in `step': SQLite3::BusyException: database is locked: UPDATE "topics" SET "approved" = ?, "updated_at" = ? WHERE "topics"."id" = ? (ActiveRecord::StatementInvalid) ``` ```ruby $ ARCONN=sqlite3 bin/test test/cases/transactions_test.rb:979 -v Using sqlite3 Run options: -v --seed 25520 ConcurrentTransactionTest#test_transaction_isolation__read_committed = 0.12 s = E /home/yahonda/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sqlite3-1.3.13/lib/sqlite3/statement.rb:108:in `step': SQLite3::BusyException: database is locked: UPDATE "developers" SET "salary" = ?, "updated_at" = ?, "updated_on" = ? WHERE "developers"."id" = ? (ActiveRecord::StatementInvalid) ```
* | | | | | | | | Merge pull request #31093 from bogdanvlviv/express-console-command-in-the-logRafael França2017-11-081-1/+1
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Change output log about skipping instalation of Active Storage