aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add missing documentation options to number_to_currency [ci skip]emaxi2018-07-112-0/+10
|
* Raise `TransactionTimeout` when lock wait timeout exceeded for PG adapterRyuta Kamizono2017-11-114-3/+35
| | | | Follow up of #30360.
* Should test actual error which is raised from the databaseRyuta Kamizono2017-11-111-1/+23
|
* Add missing autoload `Type` (#31123)Ryuta Kamizono2017-11-1119-17/+2
| | | | | | | | | | | | | | | | | | | | | | | Attribute modules (`Attribute`, `Attributes`, `AttributeSet`) uses `Type`, but referencing `Type` before the modules still fail. ``` % ./bin/test -w test/cases/attribute_test.rb -n test_with_value_from_user_validates_the_value Run options: -n test_with_value_from_user_validates_the_value --seed 31876 E Error: ActiveModel::AttributeTest#test_with_value_from_user_validates_the_value: NameError: uninitialized constant ActiveModel::AttributeTest::Type /Users/kamipo/src/github.com/rails/rails/activemodel/test/cases/attribute_test.rb:233:in `block in <class:AttributeTest>' bin/test test/cases/attribute_test.rb:232 Finished in 0.002985s, 335.0479 runs/s, 335.0479 assertions/s. 1 runs, 1 assertions, 0 failures, 1 errors, 0 skips ``` Probably we need more autoloading at least `Type`.
* Relation merging should keep joining orderRyuta Kamizono2017-11-112-10/+17
| | | | | | | `joins_values.partition` will break joins values order. It should be kept as user intended order. Fixes #15488.
* Add missing require "active_support/core_ext/hash/indifferent_access"Ryuta Kamizono2017-11-101-0/+2
| | | | https://travis-ci.org/rails/rails/jobs/300163454#L2236
* Fix random CI failure due to non-deterministic sorting orderRyuta Kamizono2017-11-101-1/+1
| | | | https://travis-ci.org/rails/rails/jobs/300163487#L1974
* Consolidate duplicated `to_ary`/`to_a` definitions in `Relation` and ↵Ryuta Kamizono2017-11-103-6/+9
| | | | `CollectionProxy`
* 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