aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Enable Style/ParenthesesAroundCondition copRyuta Kamizono2018-08-196-7/+10
| | | | | | | | | | | | | | | | To prevent style check in review like https://github.com/rails/rails/pull/33608#discussion_r211087605.
* | | | Merge pull request #33413 from ↵Javan Makhmali2018-08-182-2/+22
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | cseelus/active-storage-direct-uploads-multiple-submit-buttons Support multiple submit buttons in Active Storage forms
| * | | | Enable multiple submit buttons for Active Storage formsChris Seelus2018-08-182-2/+22
|/ / / /
* | | | Fix unclosed tags [ci skip]yuuji.yaginuma2018-08-182-2/+2
| | | |
* | | | Increment execution count before deserialize argumentsyuuji.yaginuma2018-08-183-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the execution count increments after deserializes arguments. Therefore, if an error occurs with deserialize, it retries indefinitely. In order to prevent this, the count is moved before deserialize. Fixes #33344.
* | | | Merge pull request #33645 from arye-dov-eidelman/masterRichard Schneeman2018-08-171-1/+5
|\ \ \ \ | | | | | | | | | | [skip ci] Fix overlapping text in the guide
| * | | | [skip ci] Fix overlapping text in the guideArye Dov Eidelman2018-08-171-1/+5
|/ / / / | | | | | | | | | | | | Fix a layout issue in the rails guides, where the navigation covers the main text, if the page is between 800 and 960 pixels wide. (issue #33406)
* | | | Remove unused requiresyuuji.yaginuma2018-08-171-3/+0
| | | |
* | | | Merge pull request #33537 from ↵Ryuta Kamizono2018-08-171-0/+15
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | ZASMan/update_action_mailer_docs_custom_view_paths Add note for custom mailer view paths in action mailer guide. [ci skip]
| * | | | Add note for custom mailer view paths in action mailer guide. [ci skip]Zane2018-08-161-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds stuff Fixes a typo Integrates changes Adds link to append_view_path in actionmailer guide.
* | | | | Merge pull request #33636 from wjordan/normalize_encode_params_require_hashYuji Yaginuma2018-08-171-0/+2
|\ \ \ \ \ | | | | | | | | | | | | add missing indifferent_access require for #normalize_encode_params
| * | | | | add missing indifferent_access require for #normalize_encode_paramsWill Jordan2018-08-161-0/+2
|/ / / / / | | | | | | | | | | | | | | | Fixes #33634.
* | | | | Merge pull request #33633 from utilum/update_image_processing_to_latest_versionRyuta Kamizono2018-08-171-4/+4
|\ \ \ \ \ | |_|/ / / |/| | | | Update image_processing to the latest version
| * | | | Update image_processing to the latest versionutilum2018-08-161-4/+4
|/ / / / | | | | | | | | | | | | | | | | | | | | Version 1.6.0 includes https://github.com/janko-m/image_processing/commit/3a958bc419854703860fae606423bca3667a4127 which saves us a warning: shadowing outer local variable - options. I see it locally, but for some reason not on the CI.
* | | | Merge pull request #33576 from aried3r/patch-5Richard Schneeman2018-08-161-7/+7
|\ \ \ \ | | | | | | | | | | Harmonize shell commands in dev guide [ci skip]
| * | | | Harmonize shell commands in dev guide [ci skip]Anton Rieder2018-08-161-7/+7
| | | | |
* | | | | Merge pull request #33585 from yahonda/diag33520Ryuta Kamizono2018-08-163-1/+26
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | SQLite3 adapter `alter_table` method restores foreign keys
| * | | | | SQLite3 adapter `alter_table` method restores foreign keysYasuo Honda2018-08-113-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | Related to #33520
* | | | | | Merge pull request #33603 from kamipo/fix_numericality_validatorRyuta Kamizono2018-08-164-2/+28
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | Fix numericality validator not to be affected by custom getter
| * | | | | Fix numericality validator not to be affected by custom getterRyuta Kamizono2018-08-134-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since fe9547b6, numericality validator would parse raw value only when a value came from user to work type casting to a value from database. But that was caused a regression that the validator would work against getter value instead of parsed raw value, a getter is sometimes customized by people. #33550 There we never guarantees that the value before type cast was going to the used in this validation (actually here is only place that getter value might not be used), but we should not change the behavior unless there is some particular reason. The purpose of fe9547b6 is to work type casting to a value from database. We could achieve the purpose by using `read_attribute`, without using getter value. Fixes #33550.
* | | | | | Merge pull request #33629 from bogdanvlviv/follow-33626Ryuta Kamizono2018-08-161-0/+8
|\ \ \ \ \ \ | | | | | | | | | | | | | | Add example `perform_enqueued_jobs` without block to api docs [ci skip]
| * | | | | | Add example `perform_enqueued_jobs` without block to api docs [ci skip]bogdanvlviv2018-08-161-0/+8
|/ / / / / / | | | | | | | | | | | | | | | | | | Follow up #33626
* | | | | | Extract ActiveStorage::SetCurrentGeorge Claghorn2018-08-163-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | Provide a handy concern for custom Active Storage controllers that can't inherit from ActiveStorage::BaseController.
* | | | | | Enable Lint/UriEscapeUnescape cop not to allow using obsolete methods in the ↵Ryuta Kamizono2018-08-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | future Follow up #33627.
* | | | | | Merge pull request #33627 from vbrazo/fixtures/fix-obsolete-methodsRyuta Kamizono2018-08-161-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix obsoleted method URI.unescape in activesupport/test
| * | | | | | Fix obsoleted method URI.unescape in activesupport/testVitor Oliveira2018-08-151-1/+1
| | | | | | |
* | | | | | | Merge pull request #33626 from kddeisz/perform-enqueued-jobs-no-blockGuillermo Iguaran2018-08-153-8/+45
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Allow `perform_enqueued_jobs` to be called without a block.
| * | | | | | | Allow `perform_enqueued_jobs` to be called without a block.Kevin Deisz2018-08-153-8/+45
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | Performs all of the jobs that have been enqueued up to this point in the test.
* / / / / / / Do not show deprecate task in the task listyuuji.yaginuma2018-08-161-1/+0
|/ / / / / /
* | | | | | Merge pull request #33499 from lsylvester/caller-ignore-pathsKasper Timm Hansen2018-08-157-37/+73
|\ \ \ \ \ \ | | | | | | | | | | | | | | use BacktraceCleaner for ActiveRecord verbose logging
| * | | | | | Use backtrace cleaner to clean up backtrace for verbose query logsLachlan Sylvester2018-08-147-37/+73
| | | | | | |
* | | | | | | Merge pull request #33559 from anniecodes/dev-taskKasper Timm Hansen2018-08-155-17/+115
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Move `dev:cache` rake task to use Rails::Command
| * | | | | | | Have `bin:rake dev:cache` use the Dev Rails Command under the hoodAnnie-Claude Côté2018-08-132-17/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Call the Rails::Command::DevCommand in the rake task for dev:cache * Add deprecation for using `bin/rake` in favor of `bin/rails`
| * | | | | | | Adds Rails:Command for `dev:cache` that has the same behaviour as the rake taskAnnie-Claude Côté2018-08-132-0/+79
| | | | | | | |
| * | | | | | | Update Changelog to add deprecation to `rake dev:cache`Annie-Claude Côté2018-08-131-0/+4
| | |/ / / / / | |/| | | | |
* | | | | | | Merge pull request #33605 from assain/purpose-metadata-changelog-and-testsKasper Timm Hansen2018-08-152-8/+20
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Changelog and improved tests for purpose metadata added to cookies
| * | | | | | | Changelog for the new purpose metadata and improved testsAssain2018-08-132-8/+20
| |/ / / / / /
* | | | | / / Fix broken list formatting [ci skip]yuuji.yaginuma2018-08-151-4/+4
| |_|_|_|/ / |/| | | | |
* | | | | | Merge pull request #33620 from bogdanvlviv/fix-rubocop-offensesRyuta Kamizono2018-08-152-2/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix rubocop offenses
| * | | | | | Fix rubocop offensesbogdanvlviv2018-08-152-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Layout/TrailingWhitespace ``` actionpack/lib/action_controller/metal/request_forgery_protection.rb:49:4: C: Layout/TrailingWhitespace: Trailing whitespace detected. # ^ ``` Related to c3787494eda - Performance/StartWith ``` tasks/release.rb:108:44: C: Performance/StartWith: Use String#start_with? instead of a regex match anchored to the beginning of the string. header += "* No changes.\n\n\n" if current_contents =~ /\A##/ ```
* | | | | | | Merge pull request #33612 from bogdanvlviv/test-assert_calledRyuta Kamizono2018-08-151-0/+10
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Test `assert_called` and `assert_called_with`
| * | | | | | | Test `assert_called` and `assert_called_with`bogdanvlviv2018-08-141-0/+10
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - ActiveSupport::Testing::MethodCallAssertions#assert_called - Ensure that the method stubbed by `assert_called` returns correct value after - ActiveSupport::Testing::MethodCallAssertions#assert_called_with - Ensure that `#assert_called_with` stubs the method to return a specific value - Ensure that the method stubbed by `assert_called_with` returns correct value after
* | | | | | | Merge pull request #33618 from yskkin/bulk_change_table_commentRyuta Kamizono2018-08-152-3/+16
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | Fix bulk change table ignores comment option on PostgreSQL.
| * | | | | | Fix bulk change table ignores comment option on PostgreSQL.Yoshiyuki Kinjo2018-08-152-3/+16
|/ / / / / /
* | | | | | Merge pull request #33617 from bogdanvlviv/follow-up-33530George Claghorn2018-08-143-7/+16
|\ \ \ \ \ \ | | | | | | | | | | | | | | Follow up #33530
| * | | | | | Follow up #33530bogdanvlviv2018-08-153-7/+16
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move changelog entry of #33530 up in order to preserve the chronology since we always add new entries on the top of a changelog file. - Clarify the changelog entry - Clarify the docs of remove_foreign_key - Ensure reversible of `remove_foreign_key` with `:primary_key` and `:to_table` options.
* | | | | | Merge pull request #33530 from jychen7/33515-invert-remove-foreign-keyRichard Schneeman2018-08-144-4/+36
|\ \ \ \ \ \ | | | | | | | | | | | | | | 33515 invert remove foreign key support "to_table"
| * | | | | | Allow `to_table` in `invert_remove_foreign_key`Rich2018-08-144-4/+36
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remove_foreign_key supports - remove_foreign_key :accounts, :branches - remove_foreign_key :accounts, to_table: :branches but the second one is not reversible. This branch is to fix and allow second one to be reversible. [Nikolay Epifanov, Rich Chen]
* | | | | | Merge pull request #33137 from bogdanvlviv/add-array-extract-methodMatthew Draper2018-08-159-11/+107
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Add `Array#extract!`
| * | | | | Refactor `Array#extract!`bogdanvlviv2018-08-141-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid allocating the second array by using `Array#reject!` instead of `Enumerable#partition` in `Array#extract!`. There are benchmarks in order to ensure that the changes speed up the method: ``` begin require "bundler/inline" rescue LoadError => e $stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" raise e end class Array def extract_v1!(&block) unless block_given? to_enum(:extract!) { size } else extracted_elements, other_elements = partition(&block) replace(other_elements) extracted_elements end end def extract_v2! return to_enum(:extract!) { size } unless block_given? extracted_elements = [] reject! do |element| extracted_elements << element if yield(element) end extracted_elements end end gemfile(true) do source "https://rubygems.org" gem "benchmark-ips" end arrays_for_partition = Array.new(1000) { (0..10000).to_a } arrays_for_extract_v1 = Array.new(1000) { (0..10000).to_a } arrays_for_extract_v2 = Array.new(1000) { (0..10000).to_a } Benchmark.ips do |x| x.report("Array#partition") do arrays_for_partition.each do |numbers| odd_numbers, numbers = numbers.partition { |number| number.odd? } numbers end end x.report("Array#extract_v1!") do arrays_for_extract_v1.each do |numbers| odd_numbers = numbers.extract_v1! { |number| number.odd? } numbers end end x.report("Array#extract_v2!") do arrays_for_extract_v2.each do |numbers| odd_numbers = numbers.extract_v2! { |number| number.odd? } numbers end end x.compare! end ``` The result of the benchmarks: ``` ruby -v ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] ``` ``` Fetching gem metadata from https://rubygems.org/. Resolving dependencies... Using benchmark-ips 2.7.2 Using bundler 1.16.1 Warming up -------------------------------------- Array#partition 1.000 i/100ms Array#extract_v1! 1.000 i/100ms Array#extract_v2! 1.000 i/100ms Calculating ------------------------------------- Array#partition 1.390 (± 0.0%) i/s - 7.000 in 5.044843s Array#extract_v1! 2.781 (± 0.0%) i/s - 14.000 in 5.050589s Array#extract_v2! 3.151 (± 0.0%) i/s - 16.000 in 5.080608s Comparison: Array#extract_v2!: 3.2 i/s Array#extract_v1!: 2.8 i/s - 1.13x slower Array#partition: 1.4 i/s - 2.27x slower ``` Avoid `unless`/`else` in favour of an early return. The double-negative of that `else` can be confusing, even though the code layout is nearly the same. Also using of early return would improve `git diff` if we needed to change this method.