aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix: Arel Postgresql visitor generates invalid SQL for GROUPING SETS.david2018-05-282-5/+5
|
* Remove unnecessary `with_default_enforce_utf8` methodyuuji.yaginuma2018-05-281-9/+0
| | | | | Because the same method is defined in `FormWithTest` of the parent class. https://github.com/rails/rails/blob/fe9547b6fb60d92af181c8613166fa4322f8e307/actionview/test/template/form_helper/form_with_test.rb#L19..L26
* Parse raw value only when a value came from user in numericality validatorRyuta Kamizono2018-05-282-3/+8
| | | | | | | | Since `parse_raw_value_as_a_number` may not always parse raw value from database as a number without type casting (e.g. "$150.55" as money format). Fixes #32531.
* Fix that association's after_touch is not called with counter cacheRyuta Kamizono2018-05-273-0/+31
| | | | | | | | | | | | Since #31405, using `#increment!` with touch option instead of `#touch` to touch belongs_to association if counter cache is enabled. It caused the regression since `#increment!` won't invoke after_touch callbacks even if touch option is given. To fix the regression, make `#increment!` invokes after_touch callbacks if touch option is given. Fixes #31559. Fixes #32408.
* Fix inconsistent touching behavior between assigning and unassigningRyuta Kamizono2018-05-274-3/+29
| | | | | | | | | | | On belongs_to with `touch: true` association, unassigned object is caused touching, but assigned object is not touched. And also, if primary key is customized, it will touch against the wrong target looked up by the customized key as primary key. This change ensures correctly touching consistently between assigning and unassigning.
* Fix `belongs_to_counter_cache_after_update` to respect polymorphic type changeRyuta Kamizono2018-05-274-3/+21
|
* Avoid a subquery in updating counter cacheRyuta Kamizono2018-05-262-7/+8
| | | | Since UPDATE with a subquery doesn't work on MySQL.
* Fix `belongs_to_counter_cache_after_update` to respect custom primary key ↵Ryuta Kamizono2018-05-262-1/+20
| | | | | | | | | | counter If belongs_to primary key is customized, the callback will update counters against the wrong target looked up by the customized key as primary key. We need to convert the customized key into an object that can be referred to as primary key.
* Fix `different_target?` to respect custom primary key counterRyuta Kamizono2018-05-262-3/+13
|
* Eager loading won't mutate owner recordRyuta Kamizono2018-05-253-11/+27
| | | | | | | | | | | | | | | Since #31575, `BelongsToAssociation#target=` replaces owner record's foreign key to fix an inverse association bug. But the method is not only used for inverse association but also used for eager loading/preloading, it caused some public behavior changes (#32338, #32375). To avoid any side-effect in loading associations, I reverted the overriding `#target=`, then introduced `#inversed_from` to replace foreign key in `set_inverse_instance`. Closes #32375.
* Make force equality checking more strictly not to allow serialized attributeRyuta Kamizono2018-05-256-5/+32
| | | | | | | | | | | Since #26074, introduced force equality checking to build a predicate consistently for both `find` and `create` (fixes #27313). But the assumption that only array/range attribute have subtype was wrong. We need to make force equality checking more strictly not to allow serialized attribute. Fixes #32761.
* Merge pull request #32982 from ruralocity/update-dateandtime-calculations-docsGeorge Claghorn2018-05-241-2/+2
|\ | | | | Improve grammar for DateAndTime before? and after? calculations [ci skip]
| * Improve grammar for DateAndTime before? and after? calculations [ci skip]Aaron Sumner2018-05-241-2/+2
| |
* | Merge pull request #32979 from eugeneius/stale_commentRyuta Kamizono2018-05-251-1/+1
|\ \ | |/ |/| Update stale issue comment to mention 5-2-stable
| * Update stale issue comment to mention 5-2-stableEugene Kenny2018-05-241-1/+1
|/ | | | 5-2-stable is the release series that currently receives bug fixes.
* Merge pull request #32976 from oamado/fix_doc_broken_linkGuillermo Iguaran2018-05-241-1/+1
|\ | | | | update README link: md instead rdoc
| * update README link: md instead rdoc [ci skip]Oscar Amado2018-05-241-1/+1
|/
* Merge pull request #32975 from oamado/fix_activejob_docGuillermo Iguaran2018-05-241-1/+1
|\ | | | | correct link to activejob readme [ci skip]
| * correct link to activejob readme [ci skip]Oscar Amado2018-05-241-1/+1
|/
* Merge pull request #32968 from utilum/shadowing_outer_variableGeorge Claghorn2018-05-231-8/+6
|\ | | | | Avoid 2.6 warning: shadowing outer local variable - list
| * Avoid 2.6 warning: shadowing outer local variable - listutilum2018-05-231-8/+6
| |
* | Merge pull request #30406 from eliotsykes/reduce-spring-watch-callsRafael Mendonça França2018-05-231-6/+6
|\ \ | | | | | | | | | Minimize Spring.watch calls
| * | Minimize Spring.watch callsEliot Sykes2017-08-251-6/+6
| | |
* | | Merge pull request #32969 from utilum/enable_warningsRafael França2018-05-233-9/+9
|\ \ \ | |_|/ |/| | Enable warnings in all test tasks
| * | Enable warnings in all test tasksutilum2018-05-233-9/+9
|/ / | | | | | | Also normalize AJ task use t, like all other Rails test tasks.
* | Eager autoload mail gem when eager load is true (#32808)Samuel Cochran2018-05-232-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Eager autoload mail gem when eager load is true We had a production issue where our Sidekiq worker threads all became deadlocked while autoloading a file within the mail gem, required via ActionMailer, despite setting our Rails applicaiton to eager load. `Mail.eager_autoload!` exists and works great, ActionMailer just doesn't call it during eager loading. Adding it to the ActionMailer Railtie's eager_load_namespaces takes care of calling `Mail.eager_autoload!` during the `eager_load!` initializer. * 'Mail' isn't defined yet, use before_eager_load instead * Make sure mail is loaded * Move eager load of Mail into ActionMailer.eager_load! [Samuel Cochran + Rafael Mendonça França]
* | Merge pull request #32967 from javan/ast/jpg-video-previewsJavan Makhmali2018-05-233-7/+7
|\ \ | | | | | | Change Active Storage’s video preview format from PNG to JPG
| * | Change video preview format from PNG to JPGJavan Makhmali2018-05-233-7/+7
|/ /
* | Merge pull request #32882 from utilum/unnecessary_mockingEileen M. Uchitelle2018-05-235-39/+24
|\ \ | | | | | | remove unnecessary mocking in ActionCable tests
| * | remove unnecessary mocking in ActionCable testsutilum2018-05-225-39/+24
| | |
* | | Fix RDoc formatting: `+` doesn't work with space [ci skip]yuuji.yaginuma2018-05-231-1/+1
| | | | | | | | | | | | Follow up of #32958.
* | | Merge pull request #32822 from lxxxvi/improved_error_message_in_assert_changesRafael França2018-05-222-2/+4
|\ \ \ | | | | | | | | Clearer error message in assert_changes
| * | | Clearer error message in assert_changeslxxxvi2018-05-052-2/+4
| | | | | | | | | | | | | | | | When `to:` is passed to `assert_changes`, it now prints the well-known `"Expected: x\n Actual: y"` message. Before, the message only contained the actual value.
* | | | Merge pull request #32699 from printercu/patch-3Rafael França2018-05-221-1/+7
|\ \ \ \ | | | | | | | | | | Respect NODE_ENV when running `rails yarn:install`
| * | | | Respect NODE_ENV when running `rails yarn:install`printercu2018-04-231-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `yarn install --prod` removes dev deps, so it's impossible to run `assets:precompile` with dev npm dependencies. This change makes rake task pass NODE_ENV to yarn when explicitly set.
* | | | | Merge pull request #32851 from yskkin/doc_require_dependencyRafael França2018-05-221-0/+4
|\ \ \ \ \ | | | | | | | | | | | | Document require_dependency [ci skip]
| * | | | | Document require_dependency [ci skip]Yoshiyuki Kinjo2018-05-091-0/+4
| | | | | |
* | | | | | Merge pull request #32144 from kazu9su/masterGeorge Claghorn2018-05-221-0/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | Add ActiveStorage::Service::DiskService#url_for_direct_upload test
| * | | | | | Add ActiveStorage::Service::DiskService#url_for_direct_upload testtommy2018-03-011-0/+4
| | | | | | |
* | | | | | | Merge pull request #32958 from frewsxcv/patch-1Rafael França2018-05-221-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Indicate `true` in a doc comment is code-like.
| * | | | | | | Indicate `true` in a doc comment is code-like.Corey Farwell2018-05-221-1/+1
|/ / / / / / /
* | | | | | | Bump minimum version of Thor to 0.19.0Guillermo Iguaran2018-05-222-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Thor 0.18 is causing failures in all the generator tests.
* | | | | | | Merge pull request #32825 from utilum/fewer_tt.eclosure_callsRafael França2018-05-221-2/+0
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | FIX: tt.eclosure is not needed for the GTG
| * | | | | | | Remove 7 years old note-to-self by tenderloveutilum2018-05-221-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduced in rails/journey@a806beb [ci skip]
* | | | | | | | Rollback parent transaction when children fails to update (#32796)Guillaume Malette2018-05-223-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rollback parent transaction when children fails to update Rails supports autosave associations on the owner of a `has_many` relationship. In certain situation, if the children of the association fail to save, the parent is not rolled back. ```ruby class Employee < ActiveRecord::Base end class Company < ActiveRecord::Base has_many(:employees) end company = Company.new employee = company.employees.new company.save ``` In the previous example, if the Employee failed to save, the Company will not be rolled back. It will remain in the database with no associated Employee. I expect the `company.save` call to be atomic, and either create all or none of the records. The persistance of the Company already starts a transaction that nests it's children. However, it didn't track the success or failure of it's children in this very situation, and the outermost transaction is not rolled back. This PR makes the change to track the success of the child insertion and rollback the parent if any of the children fail. * Change the test to reflect what we expect Once #32862 is merged, rolling back a record will rollback it's state to match the state before the database changes were applied * Use only the public API to express the tests * Refactor to avoid reassigning saved for nested reflections [Guillaume Malette + Rafael Mendonça França]
* | | | | | | | Merge pull request #32934 from aki77/fix-locale-selectorRafael França2018-05-221-7/+10
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Fix locale selector to email preview
| * | | | | | | Fix locale selectoraki2018-05-191-7/+10
| | | | | | | |
* | | | | | | | Merge pull request #32865 from yahonda/another_31988Rafael França2018-05-222-5/+56
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Disable foreign keys during `alter_table` for sqlite3 adapter
| * | | | | | | | Disable foreign keys during `alter_table` for sqlite3 adapterYasuo Honda2018-05-222-5/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike other databases, changing SQLite3 table definitions need to create a temporary table. While changing table operations, the original table needs dropped which caused `SQLite3::ConstraintException: FOREIGN KEY constraint failed` if the table is referenced by foreign keys. This pull request disables foreign keys by `disable_referential_integrity`. Also `disable_referential_integrity` method needs to execute `defer_foreign_keys = ON` to defer re-enabling foreign keys until the transaction is committed. https://www.sqlite.org/pragma.html#pragma_defer_foreign_keys Fixes #31988 - This `defer_foreign_keys = ON` has been supported since SQLite 3.8.0 https://www.sqlite.org/releaselog/3_8_0.html and Rails 6 requires SQLite 3.8 #32923 now - <Models>.reset_column_information added to address `ActiveModel::UnknownAttributeError` ``` Error: ActiveRecord::Migration::ForeignKeyChangeColumnTest#test_change_column_of_parent_table: ActiveModel::UnknownAttributeError: unknown attribute 'name' for ActiveRecord::Migration::ForeignKeyChangeColumnTest::Post. ```
* | | | | | | | | Merge pull request #32938 from utilum/range_case_equalityRafael França2018-05-225-30/+91
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Allow Range#=== and Range#cover? on Range