aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | Merge pull request #34349 from yahonda/restore_encoding_utf8mb4Ryuta Kamizono2018-10-302-0/+2
|\ \ \ \ \ | | | | | | | | | | | | Restore `encoding: utf8mb4` in database.yml
| * | | | | Restore `encoding: utf8mb4` in database.ymlYasuo Honda2018-10-302-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rails/rails#33853 and rails/rails#33929 removed `encoding: utf8mb4` from database.yml since at that time MySQL 5.1 is supported with the master branch. Since MySQL 5.1 has been dropped, we can restore `encoding: utf8mb4` in database.yml
* | | | | | Merge pull request #19388 from yakara-ltd/fix-habtm-fixture-orderRyuta Kamizono2018-10-302-0/+7
|\ \ \ \ \ \ | | | | | | | | | | | | | | Avoid violating key constraints in fixture HABTM associations
| * | | | | | Avoid violating key constraints in fixture HABTM associationsJames Le Cuirot2018-10-292-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When loading fixtures, Ruby 1.9's hash key ordering means that HABTM join table rows are always loaded before the parent table rows, violating foreign key constraints that may be in place. This very simple change ensures that the parent table's key appears first in the hash. Violations may still occur if fixtures are loaded in the wrong order but those instances can be avoided unlike this one.
* | | | | | | Merge pull request #34196 from gmcgibbon/connection_switch_string_nameEileen M. Uchitelle2018-10-303-6/+63
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Add support for hash and url configs to be used in connected_to
| * | | | | | | Add support for hash and url configs in connected_toGannon McGibbon2018-10-263-6/+63
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Add support for hash and url configs in database hash of `ActiveRecord::Base.connected_to`.
* | | | | | | Exercise HABTM fixtures with foreign key constraintsRyuta Kamizono2018-10-302-45/+52
| | | | | | |
* | | | | | | We don't want these internal methods as public methods in our controllersAkira Matsuda2018-10-301-23/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | or they would be listed in `action_methods`
* | | | | | | Missing require "active_support/executor"Akira Matsuda2018-10-301-0/+1
| | | | | | |
* | | | | | | Missing require "core_ext/module/attribute_accessors"Akira Matsuda2018-10-301-0/+1
| | | | | | |
* | | | | | | Missing require "active_support/concern"Akira Matsuda2018-10-301-0/+2
| | | | | | |
* | | | | | | Merge pull request #34338 from ↵Ryuta Kamizono2018-10-302-4/+4
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | malclocke/document_exception_class_for_restrict_with_exception Document exception from restrict_with_exception [ci skip]
| * | | | | | Document exception from restrict_with_exception [ci skip]Malcolm Locke2018-10-292-4/+4
| | | | | | |
* | | | | | | Merge pull request #34335 from robin850/update-bug-report-templatesRyuta Kamizono2018-10-2911-87/+11
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Update bug report templates
| * | | | | | | Update bug report templatesRobin Dupret2018-10-2811-87/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given that Bundler 1.10 was released back in 2015, we can assume that people are at least on this version or a higher one so there is no need to ask people to upgrade. Also, given that Rails 5.0 supports Ruby 2.2+ and given that this version come with Minitest 5.4.3 bundled, we don't need to ensure backward compatibility with Minitest 4.
* | | | | | | | Merge pull request #34334 from ↵Ryuta Kamizono2018-10-291-2/+3
|\ \ \ \ \ \ \ \ | |_|/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | albertoalmagro/privatize-constants-activesupport-timezone Privatize and add # :nodoc: to constants
| * | | | | | | Privatize and add # :nodoc: to constantsAlberto Almagro2018-10-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both `UTC_OFFSET_WITH_COLON` and `UTC_OFFSET_WITHOUT_COLON` are only used within `ActiveSupport::TimeZone` and in my opinion they do not provide relevant information that should appear in the docs.
* | | | | | | | Registers e302725 in the CHANGELOG [ci skip]Xavier Noria2018-10-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | References #34253.
* | | | | | | | Merge pull request #34333 from albertoalmagro/fix-activemodel-dirty-changed-docRobin Dupret2018-10-281-1/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Fix grammar in changed? docs [ci skip]
| * | | | | | | | Fix grammar in changed? docs [ci skip]Alberto Almagro2018-10-281-1/+1
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | See https://english.stackexchange.com/questions/23218/anyone-has-or-anyone-have-seen-them
* | | | | | | | Merge pull request #34253 from ↵Xavier Noria2018-10-285-1/+52
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | haberbyte/fix_autoload_on_activestorage_downloader Fix autoloading issue with ActiveStorage::Downloader
| * | | | | | | Improve the logic that detects non-autoloaded constantsJan Habermann2018-10-285-1/+52
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you require `nokogiri` from `app/models/user.rb`, dependencies.rb does not mark `Nokogiri` as an autoloaded constant, as expected. But the logic to detect these non-autoloaded constants is incomplete. See the tests defined in the patch for some cases incorrectly handled.
* | | | | | | Use release dates for versions in Rails Guides indexOlivier Lacan2018-10-271-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We repeat the phrase "Release Notes" even though release note are listed under a... "Release Notes" category already. With this change, instead of repeating ourselves, we can give people a sense of the recency of each release by simply listing the month and year of each release. This is a follow-up to #34265 as suggested by @jeremy. [ci skip]
* | | | | | | `exists?` with string argument is not invalid typeRyuta Kamizono2018-10-271-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Any type can be a primary key, so blank string is also valid value. Closes #26356.
* | | | | | | `create_table` with `:primary_key` option has no effect if `id: false` is givenRyuta Kamizono2018-10-273-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use column definition with `primary_key: true` instead.
* | | | | | | Merge pull request #34329 from r7kamura/feature/where-exclamation-consistencyRyuta Kamizono2018-10-272-1/+5
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | Ignore empty condition on #construct_relation_for_exists
| * | | | | | Ignore empty condition on #construct_relation_for_existsr7kamura2018-10-272-1/+5
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At https://github.com/rails/rails/commit/fc0e3354af7e7878bdd905a95ce4c1491113af9a, ```rb relation = relation.where(conditions) ``` was rewritten to: ```rb relation.where!(condition) ``` This change accidentally changed the result of `Topic.exists?({})` from true to false. To fix this regression, first I moved the blank check logic (`opts.blank?`) from `#where` to `#where!`, because I thought `#where!` should be identical to `#where`, except that instead of returning a new relation, it adds the condition to the existing relation. But on second thought after some discussion on https://github.com/rails/rails/pull/34329, I started to think that just fixing `#construct_relation_for_exists` is more preferable than changing `#where` and `#where!`.
* | | | | | Merge pull request #34266 from esquith/improve-no-response-file-wordingEileen M. Uchitelle2018-10-261-5/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | Improve no-response file wording
| * | | | | | Changed wording for no-response documentationEsquith Allen2018-10-201-5/+4
| | | | | | |
* | | | | | | Merge pull request #34208 from yskkin/inspect_with_parameter_filterRyuta Kamizono2018-10-267-55/+185
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Implement AR#inspect using ParameterFilter
| * | | | | | | Implement AR#inspect using ParamterFilter.Yoshiyuki Kinjo2018-10-197-55/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AR instance support `filter_parameters` since #33756. Though Regex or Proc is valid as `filter_parameters`, they are not supported as AR#inspect. I also add :mask option and #filter_params to `ActiveSupport::ParameterFilter#new` to implement this.
* | | | | | | | Merge pull request #34307 from kamipo/mysql_expression_supportRyuta Kamizono2018-10-268-11/+83
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Support default expression and expression indexes for MySQL
| * | | | | | | | Support default expression for MySQLRyuta Kamizono2018-10-255-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MySQL 8.0.13 and higher supports default value to be a function or expression. https://dev.mysql.com/doc/refman/8.0/en/create-table.html
| * | | | | | | | Support expression indexes for MySQLRyuta Kamizono2018-10-255-7/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MySQL 8.0.13 and higher supports functional key parts that index expression values rather than column or column prefix values. https://dev.mysql.com/doc/refman/8.0/en/create-index.html
* | | | | | | | | Merge pull request #34318 from bogdanvlviv/partly-revert-31819Ryuta Kamizono2018-10-261-26/+0
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Partly revert #31819
| * | | | | | | | | Partly revert #31819bogdanvlviv2018-10-261-26/+0
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PR#31819 changed `#preloaders_on` and added some test, then #33938 reverted changes that were added to the method in #31819. Since changes in the method were reverted and as mentioned in the comment https://github.com/rails/rails/pull/31819#discussion_r221847481 that titles of the tests added in #31819 don't reflect implementation I think we can remove those test for now.
* | | | | | | | | Merge pull request #34313 from GeniusStorm/add_maxlength_to_textfield_docGannon McGibbon2018-10-251-0/+3
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Add maxlength attribute usage example to Text Field Api documentation
| * | | | | | | | | Added maxlength example to text_field documentationRaghu Kamat2018-10-251-0/+3
| | |_|_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The usage of maxlength in the text_field helper adds a size attribute to the generated text_field input with the same value as the maxlength. This implicit addition of size attribute by the method gives a false impression that it may be bug. By adding the implementation of the maxlength to the api docs, we explicitly tell the reader referring the api doc that addition of size along with maxlength is the expected behaviour. [ci skip]
* | | | | | | | | Merge pull request #34317 from bogdanvlviv/fix-assert_called_withRafael França2018-10-254-15/+3
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | `assert_called_with` should require `args` argument
| * | | | | | | | `assert_called_with` should require `args` argumentbogdanvlviv2018-10-254-15/+3
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two main reasons why `assert_called_with` should require `args` argument: 1) If we want to assert that some method should be called and we don't need to check with which arguments it should be called then we should use `assert_called`. 2) `assert_called_with` without `args` argument doesn't assert anything! ```ruby assert_called_with(@object, :increment) do @object.decrement end ``` It causes false assertions in tests that could cause regressions in the project. I found this bug by working on [minitest-mock_expectations](https://github.com/bogdanvlviv/minitest-mock_expectations) gem. This gem is an extension for minitest that provides almost the same method call assertions. I was wondering whether you would consider adding "minitest-mock_expectations" to `rails/rails` instead of private `ActiveSupport::Testing::MethodCallAssertions` module. If yes, I'll send a patch - https://github.com/bogdanvlviv/rails/commit/a970ecc42c3a9637947599f2c13e3762e4b59208
* | | | | | | | Merge pull request #34309 from oliverguenther/patch-1Eileen M. Uchitelle2018-10-251-0/+20
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Document `deep_interpolation` parameter for bulk lookups
| * | | | | | | | Document `deep_interpolation` parameter for bulk lookupsOliver Günther2018-10-251-0/+20
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bulk lookups are sort of an edge case, I have not heard of them until a colleague of mine decided to dynamically iterate over a growing set of translations and receiving them in bulk as a hash with `I18n.t 'welcome'` as in the example above. When passing an interpolation to these bulk lookups, they will only be performed when also passing `deep_interpolation: true`. **Without passing `deep_interpolation` flag:** ```ruby I18n.t 'welcome', app_name: 'book store' # => {:title=>"Welcome!", :content=>"Welcome to the %{app_name}"} **With passing `deep_interpolation`:** I18n.t 'welcome', deep_interpolation: true, app_name: 'book store' # => {:title=>"Welcome!", :content=>"Welcome to the book store"} ``` I found this digging in the I18n lookup backend, the flag is listed on [I18n's Rubydoc](https://www.rubydoc.info/github/svenfuchs/i18n/master/I18n) but not otherwise listed. Since bulk lookups are mentioned here, I suggest to add a note with this flag along with it.
* / / / / / / / Deterministic connection collation in testsRyuta Kamizono2018-10-251-0/+1
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default collation for utf8mb4 is changed to utf8mb4_0900_ai_ci in MySQL 8.0, so `test_mysql_connection_collation_is_configured` is affected by MySQL version and/or default_collation_for_utf8mb4 system variable. https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_collation_for_utf8mb4 ``` % ARCONN=mysql2 be ruby -w -Itest test/cases/adapters/mysql2/connection_test.rb -n test_mysql_connection_collation_is_configured Using mysql2 Run options: -n test_mysql_connection_collation_is_configured --seed 10421 # Running: F Failure: Mysql2ConnectionTest#test_mysql_connection_collation_is_configured [test/cases/adapters/mysql2/connection_test.rb:108]: Expected: "utf8mb4_general_ci" Actual: "utf8mb4_0900_ai_ci" rails test test/cases/adapters/mysql2/connection_test.rb:106 Finished in 0.013842s, 72.2450 runs/s, 144.4900 assertions/s. 1 runs, 2 assertions, 1 failures, 0 errors, 0 skips ```
* | | | | | | Merge pull request #34204 from XrXr/aj-test-helper-argsRafael França2018-10-243-15/+20
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Include deserialized arguments in jobs returned by AJ test helpers
| * | | | | | | Include deserialized arguments in jobs returned by AJ test helpersAlan Wu2018-10-123-15/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `assert_enqueued_with` and `assert_performed_with` return a instantiated instance of the matching job for further assertion (#21010). Before this commit the `arguments` method on the returned instance returns a serialized version of the arguments.
* | | | | | | | Merge pull request #34303 from kamipo/lazy_checking_boundableRafael França2018-10-246-9/+18
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Lazy checking whether or not values in IN clause are boundable
| * | | | | | | | Lazy checking whether or not values in IN clause are boundableRyuta Kamizono2018-10-246-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since #33844, eager loading/preloading with too many and/or too large ids won't be broken by pre-checking whether the value is constructable or not. But the pre-checking caused the type to be evaluated at relation build time instead of at the query execution time, that is breaking an expectation for some apps. I've made the pre-cheking lazy as much as possible, that is no longer happend at relation build time.
* | | | | | | | | Merge pull request #34034 from runephilosof/patch-2Gannon McGibbon2018-10-241-0/+3
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Make it easier to find abort documentation
| * | | | | | | | | Make it easier to find abort documentationRune Philosof2018-10-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure how to abort is documented on https://api.rubyonrails.org/classes/ActiveSupport/Callbacks.html
* | | | | | | | | | Merge pull request #34302 from kylekeesling/activestorage-attachment-model-docsRobin Dupret2018-10-241-3/+2
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Update ActiveStorage Attachment model documentation [ci skip]