aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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]
| * | | | update activestorage attachment model documentation reflect recent behavior ↵Kyle Keesling2018-10-241-3/+2
|/ / / / | | | | | | | | | | | | changes
* | | | Merge pull request #34080 from baerjam/add-email-observer-to-guidesGannon McGibbon2018-10-231-5/+24
|\ \ \ \ | | | | | | | | | | Add observing emails to action mailer guide [ci skip]
| * | | | Add observing emails to action mailer guide [ci skip]James Baer2018-10-041-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds information on using email observer classes with Action Mailer. Intercepting Emails section is changed to "Intercepting and Observing Emails", with a sub-section on each topic. Also includes slight reworking of the Intercepting Emails summary to flow with the new structure.
* | | | | Do not need to mention the method that is being called in the exceptionRafael Mendonça França2018-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | What is important to tell is that the database configuration could not be loaded. Fixes #34296.
* | | | | Merge pull request #34275 from bogdanvlviv/skip_yarn-to-skip_javascriptRafael França2018-10-2310-27/+17
|\ \ \ \ \ | | | | | | | | | | | | Remove `--skip-yarn` in favor of `--skip-javascript`
| * | | | | Remove node_modules path from assets load paths since we use webpack by defaultbogdanvlviv2018-10-222-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | Related to #33079
| * | | | | Remove `--skip-yarn` in favor of `--skip-javascript`bogdanvlviv2018-10-2210-19/+17
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | Since #33079 Webpacker the default JavaScript compiler for Rails. Webpacker uses `yarn` so seems like it doesn't make sense for Rails to keep `--skip-yarn` option.
* | | | | Merge pull request #34297 from ↵Robin Dupret2018-10-231-5/+0
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | albertoalmagro/full-remove-upgrade-information-from-assets-pipeline-guide Fully remove duplicated upgrade information [ci skip]
| * | | | | Fully remove duplicated upgrade information [ci skip]Alberto Almagro2018-10-231-5/+0
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | On #34261 we removed the whole upgrade section. This warning is also included in the Upgrade guides [here](https://github.com/rails/rails/blame/master/guides/source/upgrading_ruby_on_rails.md#L1390) and should also be removed.
* | | | | Merge pull request #34295 from ohbarye/fix-typo-of-duplicated-theGeorge Claghorn2018-10-232-2/+2
|\ \ \ \ \ | | | | | | | | | | | | Fix typo of duplicated `the`
| * | | | | Fix typo of duplicated `the` [ci skip]ohbarye2018-10-242-2/+2
|/ / / / /
* | | | | Merge pull request #34294 from frodsan/patch-1Ryuta Kamizono2018-10-231-1/+1
|\ \ \ \ \ | | | | | | | | | | | | Hide PG::Connection from API docs [ci skip]
| * | | | | Hide PG::Connection from API docs [ci skip]Francesco Rodríguez2018-10-231-1/+1
|/ / / / /
* | | | | Merge pull request #34293 from tzmfreedom/fix_prlink_upgrade_5_1Ryuta Kamizono2018-10-231-1/+1
|\ \ \ \ \ | | | | | | | | | | | | [ci skip] Fix PullRequest link on Rails 5.1 Release Notes
| * | | | | Fix PullRequest link to datetime_field changes on Rails 5.1 Release Notestzmfreedom2018-10-231-1/+1
|/ / / / /
* | | | | Merge pull request #34292 from yahonda/mysql8013Ryuta Kamizono2018-10-231-1/+3
|\ \ \ \ \ | | | | | | | | | | | | MySQL 8.0.13 raises `ER_NO_REFERENCED_ROW` and `ER_ROW_IS_REFERENCED`
| * | | | | MySQL 8.0.13 raises `ER_NO_REFERENCED_ROW` and `ER_ROW_IS_REFERENCED`Yasuo Honda2018-10-231-1/+3
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when user has no parent table access privileges Refer https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-13.html#mysqld-8-0-13-errors >> * Previously, the ER_NO_REFERENCED_ROW_2 and ER_ROW_IS_REFERENCED_2 error messages for foreign key operations were displayed and revealed information about parent tables, even when the user had no parent table access privileges. Error handling for this situation has been revised: * If the user does have table-level privileges for all parent tables, ER_NO_REFERENCED_ROW_2 and ER_ROW_IS_REFERENCED_2 are displayed, the same as before. * If the user does not have table-level privileges for all parent tables, more generic error messages are displayed instead (ER_NO_REFERENCED_ROW and ER_ROW_IS_REFERENCED). << This pull request addresses these 3 failures: ```ruby $ ARCONN=mysql2 bundle exec ruby -w -Itest test/cases/adapter_test.rb -n /foreign/ Using mysql2 Run options: -n /foreign/ --seed 14251 F Failure: ActiveRecord::AdapterForeignKeyTest#test_foreign_key_violations_are_translated_to_specific_exception_with_validate_false [test/cases/adapter_test.rb:348]: [ActiveRecord::InvalidForeignKey] exception expected, not Class: <ActiveRecord::StatementInvalid> Message: <"Mysql2::Error: Cannot add or update a child row: a foreign key constraint fails: INSERT INTO `fk_test_has_fk` (`fk_id`) VALUES (1231231231)"> ... snip ... rails test test/cases/adapter_test.rb:343 F Failure: ActiveRecord::AdapterForeignKeyTest#test_foreign_key_violations_on_delete_are_translated_to_specific_exception [test/cases/adapter_test.rb:368]: [ActiveRecord::InvalidForeignKey] exception expected, not Class: <ActiveRecord::StatementInvalid> Message: <"Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails: DELETE FROM fk_test_has_pk WHERE pk_id = 1"> ... snip ... rails test test/cases/adapter_test.rb:365 F Failure: ActiveRecord::AdapterForeignKeyTest#test_foreign_key_violations_on_insert_are_translated_to_specific_exception [test/cases/adapter_test.rb:358]: [ActiveRecord::InvalidForeignKey] exception expected, not Class: <ActiveRecord::StatementInvalid> Message: <"Mysql2::Error: Cannot add or update a child row: a foreign key constraint fails: INSERT INTO fk_test_has_fk (fk_id) VALUES (0)"> ... snip ... rails test test/cases/adapter_test.rb:357 Finished in 0.087370s, 34.3366 runs/s, 34.3366 assertions/s. 3 runs, 3 assertions, 3 failures, 0 errors, 0 skips $ ```
* | | | | Merge pull request #34286 from rails/fix-csp-dynamic-sourcesAndrew White2018-10-233-6/+41
|\ \ \ \ \ | | | | | | | | | | | | Fix CSP dynamic sources
| * | | | | Use request object for context if there's no controllerAndrew White2018-10-223-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no controller instance when using a redirect route or a mounted rack application so pass the request object as the context when resolving dynamic CSP sources in this scenario. Fixes #34200.
| * | | | | Apply mapping to symbols returned from dynamic CSP sourcesAndrew White2018-10-223-3/+21
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously if a dynamic source returned a symbol such as :self it would be converted to a string implicity, e.g: policy.default_src -> { :self } would generate the header: Content-Security-Policy: default-src self and now it generates: Content-Security-Policy: default-src 'self'
* | | | | Merge pull request #34284 from ↵Rafael França2018-10-231-5/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | bogdanvlviv/remove-mention-about-javascript-from-generators-guide Remove mentions about `javascripts` option from the guide about generators [ci skip]
| * | | | | Remove mentions about `javascripts` option from the guide about generators ↵bogdanvlviv2018-10-221-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip] This option is unused since #33079. Follow up #34277
* | | | | | Merge pull request #34290 from ↵Rafael França2018-10-231-0/+18
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | aergonaut/docs/ActiveSupport--Notifications-subscribe Add docs to ActiveSupport::Notifications.subscribe
| * | | | | | Add docs to ActiveSupport::Notifications.subscribeChris Fung2018-10-221-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
* | | | | | | Merge pull request #34261 from ↵Ryuta Kamizono2018-10-231-57/+0
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | matildasmeds/guides_remove_upgrade_section_from_asset_pipeline_guide Remove "Upgrading from Old Versions" from Asset Pipeline Guide [skip ci]
| * | | | | | | Remove "Upgrading Old Versions" from Asset Pipeline Guide [skip ci]Matilda Smeds2018-10-191-57/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * How to upgrade Rails 2.x/3.2 not relevant for this Guide * All configuration changes are already included in Upgrading Ruby on Rails Guide
* | | | | | | | Merge pull request #34289 from jschulenklopper/patch-1George Claghorn2018-10-221-1/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Add missing dot in comment in .gitignore template
| * | | | | | | | Add missing dot in comment in .gitignore templateJochem Schulenklopper2018-10-221-1/+1
| | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | My submission for the tiniest commit and PR contest: add a missing dot in a comment line in the generator template for .gitignore. (I just noticed this missing; consistency is king :-)
* | | | | | | | Merge pull request #34222 from bogdanvlviv/unify-changelog-entriesRafael França2018-10-221-24/+8
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Unify changelog entries related to `database` option of Rails generators [ci skip]
| * | | | | | | Unify changelog entries related to `database` option of Rails generators [ci ↵bogdanvlviv2018-10-161-24/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | skip] `migrations_paths` option was added to migration generator, with changelog entry, in #33760. Also `migrations_paths` option was added to model generator, with changelog entry, in #33994. Then `migrations_paths` was renamed to `database` and aliased as `db` in #34021, and was added new changelog entry. I think we should edit existed changelog entries instead adding new about changing the name of the option from `migrations_paths` to `database` since Rails 6.0 hasn't been released yet, and since It might confuse readers of the changelog file in case if they've read changelog enty about adding `migrations_paths` option but haven't read the entry about change the name of that option to `database`. @eileencodes, @gmcgibbon, @rafaelfranca Does it make sense?
* | | | | | | | Merge pull request #34278 from ↵Gannon McGibbon2018-10-221-3/+2
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GeniusStorm/remove_dependent_destroy_from_belongs_to_doc Fix #33914 : Remove dependent: :destroy option from the belong_to example since there is a warning associated with the usage of dependent: :destroy along with belongs_to
| * | | | | | | | [ci skip] Fix #33914Raghu Kamat2018-10-221-3/+2
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes the dependent: :destroy option from the belong_to example since there is a warning associated with the usage of dependent: :destroy along with belongs_to. Based on the feedback on the issue #33914, I replaced dependent: :destroy with touch: :books_updated_at which will make the example consistent with the example that already exists on that page. * Also Removing the touch option from the belong_to scopes example as the option doesnt have any relation to association scope.
* | | | | | | | Merge pull request #34241 from gmcgibbon/clarify_i18n_load_paths_gotchaRafael França2018-10-221-1/+3
|\ \ \ \ \ \ \ \ | |_|_|_|/ / / / |/| | | | | | | Clarify i18n load paths gotcha
| * | | | | | | [ci skip] Clarify load_paths behaviourGannon McGibbon2018-10-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clarify `I18n.load_paths` vs `Rails.application.config.i18n.load_paths` behaviour. [Gannon McGibbon + Alberto Almagro Sotelo]
| * | | | | | | [ci skip] Remove explicit to_s for consistency with other exampleTrevor Wistaff2018-10-161-1/+1
| | | | | | | |