aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | Add cases to test combining validation conditionsbogdanvlviv2017-11-065-7/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Test condition that is defined by array of conditions - Test condition that is defined by combining :if and :unless - Test local condition that is defined by :if - Test local condition that is defined by :unless See http://edgeguides.rubyonrails.org/active_record_validations.html#combining-validation-conditions
* | | | | | Merge pull request #30714 from bogdanvlviv/fix-rails_db_migrate_VERSIONRafael França2017-11-067-14/+355
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix `bin/rails db:migrate` with specified `VERSION`
| * | | | | | Fix `bin/rails db:migrate` with specified `VERSION`bogdanvlviv2017-11-067-14/+355
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that `bin/rails db:migrate` with specified `VERSION` reverts all migrations only if `VERSION` is `0`. Raise error if target migration doesn't exist.
* | | | | | | Fix streaming downloads from S3/Azure StorageGeorge Claghorn2017-11-063-7/+17
| | | | | | | | | | | | | | | | | | | | | Closes #31073.
* | | | | | | Remove useless `associated_records_by_owner`Ryuta Kamizono2017-11-072-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `associated_records_by_owner` had returned customizing result before calling `associate_records_to_owner` for through association subclasses. Since #22115, `associate_records_to_owner` is called in the method and not returned owner and result pairs. Removing the method will reduce method call and block call nesting.
* | | | | | | Merge pull request #31058 from ↵Rafael França2017-11-063-1/+18
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bogdanvlviv/ConfirmationValidator-with_false_value Execute `ConfirmationValidator` validation when `_confirmation`'s value is `false`
| * | | | | | | Execute `ConfirmationValidator` validation when `_confirmation`'s value is ↵bogdanvlviv2017-11-053-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `false`
* | | | | | | | Fix merge conflict and rubocop offencesRyuta Kamizono2017-11-071-19/+18
| |/ / / / / / |/| | | | | |
* | | | | | | Merge pull request #30101 from bogdanvlviv/initialization-active_storageRafael França2017-11-0634-104/+385
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Provide initialization of Active Storage
| * | | | | | | Execution of `active_storage:install` should respect `--quiet` during `rails ↵bogdanvlviv2017-11-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | new`
| * | | | | | | Rails::Generators::Actions#execute_command allows option `capture`bogdanvlviv2017-11-062-1/+23
| | | | | | | |
| * | | | | | | `rails new` runs `rails active_storage:install`bogdanvlviv2017-11-0616-38/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Omit `rails activestorage:install` for jdbcmysql, jdbc and shebang tests AppGeneratorTest#test_config_jdbcmysql_database rails aborted! LoadError: Could not load 'active_record/connection_adapters/mysql_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (compressed) bin/rails:4:in `<main>' Tasks: TOP => activestorage:install => environment (See full trace by running task with --trace) AppGeneratorTest#test_config_jdbc_database rails aborted! LoadError: Could not load 'active_record/connection_adapters/jdbc_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (compressed) bin/rails:4:in `<main>' Tasks: TOP => activestorage:install => environment (See full trace by running task with --trace) AppGeneratorTest#test_shebang_is_added_to_rails_file /home/ubuntu/.rbenv/versions/2.4.1/bin/ruby: no Ruby script found in input (LoadError) Prevent PendingMigrationError in tests * Run `bin/rails db:migrate RAILS_ENV=test` in test_cases before start tests to prevent PendingMigrationError * FileUtils.rm_r("db/migrate") * --skip-active-storage Fix failed tests in `railties/test/railties/engine_test.rb` Related to #30111 Imporve `SharedGeneratorTests#test_default_frameworks_are_required_when_others_are_removed` - Explicitly skip active_storage - Ensure that skipped frameworks are commented - Ensure that default frameworks are not commented Fix error `Errno::ENOSPC: No space left on device - sendfile` Since `rails new` runs `rails active_storage:install` that boots an app. Since adding Bootsnap 0312a5c67e35b960e33677b5358c539f1047e4e1 during booting an app, it creates the cache: 264K tmp/cache/bootsnap-load-path-cache 27M tmp/cache/bootsnap-compile-cache * teardown_app must remove app
| * | | | | | | Add --skip-active-storage and do so automatically when --skip-active-record ↵bogdanvlviv2017-11-0620-65/+270
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is used Closes #30102 Revert part 787fe90dc0a7c5b91bb5af51f2858ea8c4676268 --skip-active-storage pass throughs `rails plugin new` Add changelog entry about default initialization of Active Storage
* | | | | | | | Merge pull request #22435 from yui-knk/fix_engine_route_testRafael Mendonça França2017-11-065-6/+91
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Make `assert_recognizes` to traverse mounted engines
| * | | | | | | | Make `assert_recognizes` to traverse mounted enginesyui-knk2016-04-235-6/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit paths of mounted engines are not traversed when `assert_recognizes` is called, causing strange test results. This commit enable to traverse mounted paths.
* | | | | | | | | Merge pull request #28360 from kbrock/transaction_fixMatthew Draper2017-11-071-1/+1
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Handle Timeout.timeout in rails queries
| * | | | | | | | | Properly check transaction in persistenceKeenan Brock2017-11-061-1/+1
| | |_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` [NoMethodError]: undefined method `state' for nil:NilClass Method:[rescue in block in refresh] ``` In `within_new_transaction`, there is the possibility that `begin_transaction` returns a `nil`. (i.e.: so `transaction = nil`) So this method is checking `transaction` for nil in 2 spots. Unfortunately, there is one line that is not checking `transaction` for `nil` That line, `commit_transaction`, throws an exception for us in AR 5.0.0.1 The problem with the method is finally realized in the error checking itself. it calls `transaction.state` (i.e.: nil.state) and that is the final exception raised. The actual underlying (user) issue is hidden by this line. Solution is test transaction for nil.
* | | | | | | | | Merge pull request #22115 from bogdan/refactor-preloaderRafael França2017-11-063-81/+40
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | Refactored preloading of a though assocations
| * | | | | | | | Refactor Preloader CodeBogdan Gusiev2017-11-063-81/+40
| | | | | | | | |
* | | | | | | | | Merge pull request #31069 from ↵Rafael França2017-11-061-1/+6
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | danott/resolve-minitest-deprecation-in-assert_no_changes Resolve Minitest 6 deprecation in assert_no_changes
| * | | | | | | | | Resolve Minitest 6 deprecation in assert_no_changesDan Ott2017-11-061-1/+6
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These changes resolve a deprecation warning in `assert_no_changes` when asserting that an expression evaluates to `nil` before and after the passed block is evaluated. The smallest demonstration of this edge case: ```ruby assert_no_changes "nil" do true # noop end ``` Under the covers, this is evaluating ```ruby assert_equal nil, nil ``` Minitest 5 issues a deprecation warning, and Minitest will fail completely. For additional context, the motivations and implications of this change to Minitest have been discussed at length in [seattlerb/minitest#666][]. [seattlerb/minitest#666]: https://github.com/seattlerb/minitest/issues/666
* | | | | | | | | Fix acronym support in `humanize`Andrew White2017-11-063-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Acronym inflections are stored with lowercase keys in the hash but the match wasn't being lowercased before being looked up in the hash. This shouldn't have any performance impact because before it would fail to find the acronym and perform the `downcase` operation anyway. Fixes #31052.
* | | | | | | | | Merge pull request #31066 from Leyka/patch-1Andrew White2017-11-061-6/+6
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Fix french spelling mistake
| * | | | | | | | | Fix french spelling mistake Skander2017-11-061-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trés -> Très https://fr.wiktionary.org/wiki/tr%C3%A8s
* | | | | | | | | | Merge pull request #30620 from ↵Andrew White2017-11-067-135/+260
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | bogdanvlviv/method_signature_prev-next-day-month-year_for_time Mirror the API of Ruby stdlib for #prev_day, #next_day, #prev_month, #next_month, #prev_year, #next_year
| * | | | | | | | | Update "Active Support Core Extensions" guidebogdanvlviv2017-10-241-91/+97
| | | | | | | | | |
| * | | | | | | | | Allows pass argument for `Time#prev_year` and `Time#next_year`.bogdanvlviv2017-10-247-21/+58
| | | | | | | | | |
| * | | | | | | | | Allows pass argument for `Time#prev_month` and `Time#next_month`bogdanvlviv2017-10-247-22/+67
| | | | | | | | | |
| * | | | | | | | | Allows pass argument for `Time#prev_day` and `Time#next_day`bogdanvlviv2017-10-243-6/+43
| | | | | | | | | |
* | | | | | | | | | Merge pull request #31064 from y-yagi/remove_unused_requireRyuta Kamizono2017-11-061-1/+0
|\ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / |/| | | | | | | | | Remove unused require
| * | | | | | | | | Remove unused requireyuuji.yaginuma2017-11-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since f182831, this file does not use methods added by `module/introspection`.
* | | | | | | | | | Merge pull request #31062 from y-yagi/follow_up_of_31046Rafael França2017-11-051-1/+1
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Explicitly pass window handle to `resize_window_to`
| * | | | | | | | | | Explicitly pass window handle to `resize_window_to`yuuji.yaginuma2017-11-061-1/+1
| |/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike `resize_window`, `resize_window_to` has three arguments. https://github.com/thoughtbot/capybara-webkit/blob/d63c3c8e3ae844f0c59359532a6dcb50f4a64d0a/lib/capybara/webkit/driver.rb#L135-L143 Therefore, if pass only width and height just like `resize_window`, `ArgumentError`will be raised. To prevent this, explicitly pass window handler. Follow up of #31046
* | | | | | | | | | `scoping` should respect current class and STI constraint (#29199)Ryuta Kamizono2017-11-063-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A relation includes `klass`, so it can not be used as it is if current class is different from `current_scope.klass`. It should be created new relation by current class to respect the klass and STI constraint. Fixes #17603. Fixes #23576.
* | | | | | | | | | Fix preloading polymorphic multi-level through associationRyuta Kamizono2017-11-062-1/+18
| |_|_|_|_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is partially fixed by e617fb57 when through association has already loaded. Otherwise, second level through association should respect `preload_scope`. Fixes #30242. Closes #30076. [Ryuta Kamizono & CicholGricenchos]
* | | | | | | | | Fix preloading polymorphic association when through association has already ↵Ryuta Kamizono2017-11-062-4/+27
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | loaded If through association has already loaded, `source_type` is ignored to loaded through records. The loaded records should be filtered by `source_type` in that case. Fixes #30904.
* | | | | | | | Ensure `apply_join_dependency` for `update_all` and `delete_all` if ↵Ryuta Kamizono2017-11-062-19/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | eager-loading is needed If a relation has eager-loading values, `count` and `exists?` works properly, but `update_all` and `delete_all` doesn't work due to missing `apply_join_dependency`. It should be applied to work consistently. Fixes #28863.
* | | | | | | | Ensure `apply_join_dependency` for `collection_cache_key` if eager-loading ↵Ryuta Kamizono2017-11-065-3/+17
| |_|_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is needed Fixes #30315.
* | | | | | | Merge pull request #31053 from y-yagi/fix_namespaced_generatorEileen M. Uchitelle2017-11-053-10/+39
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Generate the correct path in nested scaffold generator
| * | | | | | | Generate the correct path in nested scaffold generatoryuuji.yaginuma2017-11-053-10/+39
| | |_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, namespaced scaffold generator will generate an incorrect path and the generated file will not work properly. ``` $ ./bin/rails g scaffold admin/user $ ./bin/rails db:migrate $ ./bin/rails t test/controllers # Running: E Error: Admin::UsersControllerTest#test_should_create_admin_user: NameError: undefined local variable or method `admin_admin_users_url' for #<Admin::UsersControllerTest:0x000055a59f25ff68> Did you mean? admin_users test/controllers/admin/users_controller_test.rb:20:in `block (2 levels) in <class:UsersControllerTest>' test/controllers/admin/users_controller_test.rb:19:in `block in <class:UsersControllerTest>' bin/rails test test/controllers/admin/users_controller_test.rb:18 ``` This is because combine `controller_class_path` and `singular_table_name` to generate route. https://github.com/rails/rails/blob/360698aa245b45349d1d1b12e1afb34759515e69/railties/lib/rails/generators/named_base.rb#L172 Normally, if using namspaced generator, table name already contains namespace. Therefore, adding `controller_class_path` adds extra namespace. Since it is special only when explicitly specifying `model-name`, it is modified to change the value only when `model-name`is specified. Follow up of #30729
* | | | | | | Merge pull request #31055 from ↵Ryuta Kamizono2017-11-051-0/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | y-yagi/show_request_forgery_protection_methods_in_api_doc Show `RequestForgeryProtection` methods in api doc [ci skip]
| * | | | | | | Show `RequestForgeryProtection` methods in api doc [ci skip]yuuji.yaginuma2017-11-051-0/+1
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several methods of `RequestForgeryProtection` are not showed in the api doc even though `:doc:` is specified. (e.g. `form_authenticity_param`) http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html These methods are listed in the doc of v4.1. http://api.rubyonrails.org/v4.1/classes/ActionController/RequestForgeryProtection.html This is due to the influence of `:nodoc:` added in #18102, methods after `CROSS_ORIGIN_JAVASCRIPT_WARNING` not showed from the doc. Therefore, in order to show the method like originally, added `startdoc` after `CROSS_ORIGIN_JAVASCRIPT_WARNING`.
* | | | | | | Merge pull request #31046 from NARKOZ/fix-capybara-webkit-deprecationEileen M. Uchitelle2017-11-041-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix Capybara::Webkit::Driver#resize_window deprecation warning
| * | | | | | | Fix Capybara::Webkit::Driver#resize_window deprecation warningNihad Abbasov2017-11-041-1/+1
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | >[DEPRECATION] Capybara::Webkit::Driver#resize_window is deprecated. Please use Capybara::Window#resize_to instead.
* | | | | | | Merge pull request #31014 from aditya-kapoor/doc-fixesEileen M. Uchitelle2017-11-041-1/+7
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | [ci skip] show the correct example to demonstrate inflections.
| * | | | | | | [ci skip] show the correct example to demonstrate inflections.Aditya Kapoor2017-11-011-1/+7
| | | | | | | |
* | | | | | | | s/an/a/Akira Matsuda2017-11-041-1/+1
| | | | | | | |
* | | | | | | | Merge pull request #31048 from ↵Ryuta Kamizono2017-11-041-4/+14
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bogdanvlviv/improve-docs-for-action_dispatch-routing-mapper Improve docs of ActionDispatch::Routing::Mapper [ci skip]
| * | | | | | | | Improve docs of ActionDispatch::Routing::Mapperbogdanvlviv2017-11-031-4/+14
| | |/ / / / / / | |/| | | | | |
* | | | | | | | Merge pull request #31050 from y-yagi/remove_unused_methodsRyuta Kamizono2017-11-041-8/+0
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Remove unused `calculate_rounded_number` and `digit_count`