aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Fix typo s/Topic/Tag/Ryuta Kamizono2018-08-231-1/+1
| | | | | | | | | | | | | | | | `Topic` isn't loaded in this test file.
* | | | Merge pull request #33704 from matthewd/helper-path-with-sizeMatthew Draper2018-08-231-2/+1
|\ \ \ \ | | | | | | | | | | Use string lengths instead of regexp to extract path
| * | | | Use string lengths instead of regexp to extract pathMatthew Draper2018-08-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The regexp was introduced in 186ac4cdaa911a9af659a29f2179a19b99dea13b, and looks cosmetic. While they should be functionally identical in theory, in practice, case insensitive (but preserving) filesystems can give results that are differently-cased from the pattern we supplied. I don't know how to force the filesystem to do the surprising thing, even when running in an environment that _could_, so no new test.
* | | | | Merge pull request #32647 from eugeneius/lazy_transactionsMatthew Draper2018-08-2317-17/+185
|\ \ \ \ \ | | | | | | | | | | | | Omit BEGIN/COMMIT statements for empty transactions
| * | | | | Omit BEGIN/COMMIT statements for empty transactionsEugene Kenny2018-08-1317-17/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a transaction is opened and closed without any queries being run, we can safely omit the `BEGIN` and `COMMIT` statements, as they only exist to modify the connection's behaviour inside the transaction. This removes the overhead of those statements when saving a record with no changes, which makes workarounds like `save if changed?` unnecessary. This implementation buffers transactions inside the transaction manager and materializes them the next time the connection is used. For this to work, the adapter needs to guard all connection use with a call to `materialize_transactions`. Because of this, adapters must opt in to get this new behaviour by implementing `supports_lazy_transactions?`. If `raw_connection` is used to get a reference to the underlying database connection, the behaviour is disabled and transactions are opened eagerly, as we can't know how the connection will be used. However when the connection is checked back into the pool, we can assume that the application won't use the reference again and reenable lazy transactions. This prevents a single `raw_connection` call from disabling lazy transactions for the lifetime of the connection.
* | | | | | Merge pull request #33696 from bogdanvlviv/follow-up-44007c070Kasper Timm Hansen2018-08-234-10/+10
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | Use `say`/`error` instead of `puts`/`$stderr.puts`
| * | | | | Use `say`/`error` instead of `puts`/`$stderr.puts`bogdanvlviv2018-08-224-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | Follow up 44007c07098a3c633180881cae9285da4622e63f
* | | | | | Merge pull request #33666 from ↵George Claghorn2018-08-229-18/+118
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | cbothner/fail-gracefully-from-activestorage-file-not-found Fail more gracefully from ActiveStorage missing file exceptions
| * | | | | | Respond with 404 in ActiveStorage::DiskController#show when file missingCameron Bothner2018-08-213-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `ActiveStorage::DiskController#show` generates a 404 Not Found response when the requested file is missing from the disk service. It previously raised `Errno::ENOENT`.
| * | | | | | Translate service-specific missing object exceptions into a generic oneCameron Bothner2018-08-217-18/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `ActiveStorage::Blob#download` and `ActiveStorage::Blob#open` raise `ActiveStorage::FileNotFoundError` when the corresponding file is missing from the storage service. Services translate service-specific missing object exceptions (e.g. `Google::Cloud::NotFoundError` for the GCS service and `Errno::ENOENT` for the disk service) into `ActiveStorage::FileNotFoundError`.
* | | | | | | Include form_with in form_helpers rails guide (#33523)Nick Schwaderer2018-08-221-53/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Include form_with in form_helpers rails guide * Include form_tag and form_for footnote * Id and class attributes are not wrapped anymore * Include note that all form_with forms are remote:true by default * Underline most common use case of form_with is with arguments * Form_with no longer accepts multiple hashes in form helper calls * Review final sections * Revert extra documentation * Remove unnecessary link
* | | | | | | Merge pull request #33698 from bogdanvlviv/follow-up-33693Rafael França2018-08-221-1/+0
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Remove extra execution of `uniq!` on action_methods
| * | | | | | | Remove extra execution of `uniq!` on action_methodsbogdanvlviv2018-08-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Execution of `to_set` below should remove duplicated elements. Follow up #33693
* | | | | | | | Merge pull request #33695 from peterzhu2118/masterRafael França2018-08-222-8/+11
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Update ParameterFilter to yield original parameters
| * | | | | | | Update ParameterFilter to yield original parametersPeter Zhu2018-08-222-8/+11
| | |/ / / / / | |/| | | | |
* | | | | | | Merge pull request #33693 from schneems/schneems/action_methodsRichard Schneeman2018-08-221-1/+4
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Two fewer array allocations on action_methods
| * | | | | | | Two fewer array allocations on action_methodsschneems2018-08-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of creating new arrays for `uniq` and `map` we can instead modify the array in place.
* | | | | | | | Merge pull request #33697 from bogdanvlviv/rails-command-help-show-descriptionRafael França2018-08-222-2/+5
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Fix `rails initializers --help` and `rails dev:cache --help`
| * | | | | | | | Fix `rails initializers --help` and `rails dev:cache --help`bogdanvlviv2018-08-222-2/+5
| | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `rails initializers --help` should show description set by `desc` See railties/lib/rails/command/base.rb:27 - Fix `rails dev:cache --help` ``` Traceback (most recent call last): 10: from bin/rails:4:in `<main>' 9: from bin/rails:4:in `require' 8: from /work/rails/railties/lib/rails/commands.rb:18:in `<top (required)>' 7: from /work/rails/railties/lib/rails/command.rb:46:in `invoke' 6: from /work/rails/railties/lib/rails/command/base.rb:65:in `perform' 5: from /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch' 4: from /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command' 3: from /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run' 2: from /work/rails/railties/lib/rails/command/base.rb:150:in `help' 1: from /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:170:in `command_help' /home/vagrant/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/base.rb:497:in `handle_no_command_error': Could not find command "dev". (Thor::UndefinedCommandError) ``` Context https://github.com/rails/rails/pull/33694#issuecomment-415127304 Would be great to set a description to other commands.
* | | | | | | | Merge pull request #33685 from krusty3002/masterRafael França2018-08-221-0/+7
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Added explanation about new_framework_defaults.rb file [ci skip]
| * | | | | | | | Fixed file name [ci skip]Claas Zurawski2018-08-221-1/+1
| | | | | | | | |
| * | | | | | | | Added explanation about new_framework_defaults.rb file [ci skip]Claas Zurawski2018-08-221-0/+7
| | | | | | | | |
* | | | | | | | | Merge pull request #33694 from bogdanvlviv/follow-up-33631Rafael França2018-08-221-1/+0
|\ \ \ \ \ \ \ \ \ | |_|/ / / / / / / |/| | | | | | | | Remove `rake initializers` from rake tasks list
| * | | | | | | | Remove `rake initializers` from rake tasks listbogdanvlviv2018-08-221-1/+0
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | Context https://github.com/rails/rails/pull/33631#discussion_r210732565
* | | | | | | | Merge pull request #33162 from utilum/stop_using_mochaKasper Timm Hansen2018-08-2211-59/+200
|\ \ \ \ \ \ \ \ | |_|/ / / / / / |/| | | | | | | Stop using Mocha
| * | | | | | | Remove Mocha from Gemfileutilum2018-08-132-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _Q.E.F._
| * | | | | | | Add method_call_assertions and use them instead of Mochautilum2018-08-136-36/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Six Mocha calls prove quite resistant to Minitestification. For example, if we replace ``` ActiveRecord::Associations::HasManyAssociation .any_instance .expects(:reader) .never ``` with `assert_not_called`, Minitest wisely raises ``` NameError: undefined method `reader' for class `ActiveRecord::Associations::HasManyAssociation' ``` as `:reader` comes from a deeply embedded abstract class, `ActiveRecord::Associations::CollectionAssociation`. This patch tackles this difficulty by adding `ActiveSupport::Testing::MethodCallAsserts#assert_called_on_instance_of` which injects a stubbed method into `klass`, and verifies the number of times it is called, similar to `assert_called`. It also adds a convenience method, `assert_not_called_on_instance_of`, mirroring `assert_not_called`. It uses the new method_call_assertions to replace the remaining Mocha calls in `ActiveRecord` tests. [utilum + bogdanvlviv + kspath]
| * | | | | | | Stub with Minitest and test with MethodCallAssertionsutilum2018-08-133-17/+30
| | |_|/ / / / | |/| | | | |
* | | | | | | Partly revert unused accessorRyuta Kamizono2018-08-231-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This was introduced at 24f6bf0d96b58f2b2ef6a886c93d35cf8ce4f293.
* | | | | | | Merge pull request #33691 from tgxworld/add_config_to_disable_advisory_locksMatthew Draper2018-08-238-4/+75
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | | Add database configuration to disable advisory locks.
| * | | | | | Add database configuration to disable advisory locks.Guo Xiang Tan2018-08-228-4/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/rails/rails/issues/31190
* | | | | | | Merge pull request #33547 from Ana06/patch-1Matthew Draper2018-08-233-3/+34
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Use public_send in value_for_collection
| * | | | | | | Add tests for privates methods in view's helpersAna María Martínez Gómez2018-08-082-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test that using private methods in `options_from_collection_for_select` is deprecated. Make the unused `secret` paramether in the `Post` Struct private to use it in the test.
| * | | | | | | Deprecate use of private methods in view's helpersAna María Martínez Gómez2018-08-082-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of dropping it completely in case someone is relying (probably inadvertenly) on it.
| * | | | | | | Add one more method affected in CHANGELOGAna María Martínez Gómez2018-08-081-2/+3
| | | | | | | |
| * | | | | | | Use public_send in extract_values_from_collectionAna María Martínez Gómez2018-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid exposing private methods in view's helpers. However, as `extract_values_from_collection` is only called from `options_from_collection_for_select` where `value_for_collection` is previously called, this case was already covered. The change makes anyway sense for consistency and in case the code changes in the future.
| * | | | | | | Use public_send in value_for_collectionAna María Martínez Gómez2018-08-072-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid exposing private methods in view's helpers. Fixes https://github.com/rails/rails/issues/33546
* | | | | | | | Merge pull request #33659 from palkan/feature/action-cable-testingEileen M. Uchitelle2018-08-228-0/+343
|\ \ \ \ \ \ \ \ | |_|/ / / / / / |/| | | | | | | [WIP] Action cable testing
| * | | | | | | Add Action Cable test case and test helperVladimir Dementyev2018-08-195-0/+255
| | | | | | | |
| * | | | | | | Add Action Cable test adapterVladimir Dementyev2018-08-193-0/+88
| | | | | | | |
* | | | | | | | Remove duplicate testutilum2018-08-221-2/+2
| |_|_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch corrects a duplicate method name introduced in #33635. Also fixes typo in method names.
* | | | | | | Merge pull request #33682 from mroutis/brewfile-add-imagemagickRafael França2018-08-211-0/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | [ci skip] Add ImageMagick to Brewfile
| * | | | | | | [ci skip] Add ImageMagick to BrewfileMr. Outis2018-08-211-0/+1
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | In order to run ActiveStorage's tests successfully, you need imagemagick
* | | | | | | Show the `ENV` value correctly in the doc of `combined_fragment_cache_key` ↵yuuji.yaginuma2018-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip] It seems to need an escape for the showing `ENV`. https://api.rubyonrails.org/classes/AbstractController/Caching/Fragments.html#method-i-combined_fragment_cache_key
* | | | | | | Add missing newline [ci skip]George Claghorn2018-08-211-0/+1
| |_|_|_|_|/ |/| | | | |
* | | | | | Merge pull request #33680 from mroutis/update-guides-activestorage-dependenciesGeorge Claghorn2018-08-211-1/+13
|\ \ \ \ \ \ | | | | | | | | | | | | | | [ci skip] Add ImageMagick to ActiveStorage dependencies
| * | | | | | [ci skip] Add ImageMagick to ActiveStorage dependenciesMr. Outis2018-08-211-1/+13
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | In order to run ActiveStorage's tests successfully, you need imagemagick.
* | | | | | Merge pull request #29838 from fschwahn/patch-1Rafael França2018-08-212-0/+16
|\ \ \ \ \ \ | | | | | | | | | | | | | | Add usage of procs without arguments to callbacks guide
| * | | | | | Improve documentation of Procs as :if / :unless options for callbacksFabian Schwahn2018-08-202-0/+16
| | | | | | |
* | | | | | | Merge pull request #33660 from y-yagi/follow_up_32121Richard Schneeman2018-08-214-0/+58
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Make `rake routes` deprecate before deleting