- 13 7月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Since 07e5301e, `Relation#first` will order by primary key if no order is defined.
-
- 04 7月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
Fixes #28324.
-
由 Ryuta Kamizono 提交于
-
- 02 7月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
It is covered by following assertion.
-
由 Matthew Draper 提交于
This reverts commit 3420a145, reversing changes made to afb66a5a.
-
- 01 7月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 30 6月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Fixes #29627.
-
- 29 6月, 2017 4 次提交
-
-
由 Ryuta Kamizono 提交于
`aliased_table_name` in `Association` was added at a3502c41. `aliased_table_name` in `JoinDependency` (added at 55854c41) is used, but it looks like that added one in `Association` is never used from the beginning.
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Passing `klass.connection` is redundant because `AssociationScope` is passed an association itself and an association has `klass`.
-
由 Ryuta Kamizono 提交于
Unscoping `default_scope` in associations has already supported (#17360 for preloading, c9cf8b8d for eager loading). Fixes #20679. Closes #16531.
-
- 28 6月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
And use `assert_same` instead of `assert_equal` and tiny fix assert message s/#reload/#reset/. Follow up of #29511.
-
由 Tobias Kraze 提交于
If a record was built on a HasManyThroughAssociation, then removed, and then the record was saved, the removed record would be created anyways.
-
- 22 6月, 2017 1 次提交
-
-
由 John Hawthorn 提交于
-
- 21 6月, 2017 1 次提交
-
-
由 John Hawthorn 提交于
The `@offsets` cache is used by FinderMethods to cache records found by find_nth. This cache is cleared in AR::Relation#reset, but not in CollectionProxy#reset or CollectionProxy#reload. Because of this, since #29098, calling #first/#find_nth/etc after calling #reload or #reset on an association could return a stale record. This is an issue both when the full association target is loaded and when the item is loaded in #find_nth. This commit solves the problem by clearing the `@offsets` cache in CollectionProxy#reset and CollectionProxy#reload.
-
- 09 6月, 2017 1 次提交
-
-
由 Alex Kitchens 提交于
A collection association will raise on `#create_association` when the parent is unpersisted. A singular association should do the same. This addresses issue #29219.
-
- 06 6月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
These `assert_nothing_raised` are covered by following assertions.
-
- 01 6月, 2017 1 次提交
-
-
由 Koichi ITO 提交于
-
- 31 5月, 2017 1 次提交
-
-
由 Koichi ITO 提交于
-
- 29 5月, 2017 1 次提交
-
-
由 Koichi ITO 提交于
-
- 28 5月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
This fixes the following issues. * `association_scope` doesn't include `default_scope`. Should use `scope` instead. * We can't use `method_missing` for customizing existing method. * We can't use `relation_delegate_class` for sharing extensions. Should extend per association.
-
- 24 5月, 2017 1 次提交
-
-
由 Koichi ITO 提交于
-
- 23 5月, 2017 1 次提交
-
-
由 bogdanvlviv 提交于
".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2
-
- 21 5月, 2017 1 次提交
-
-
由 Koichi ITO 提交于
-
- 19 5月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
`make_model` and `make_no_pk_hm_t` in `HasManyThroughAssociationsTest` are not a test case. it should be private.
-
- 11 5月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Fixes #29025.
-
- 28 4月, 2017 1 次提交
-
-
由 George Claghorn 提交于
-
- 27 4月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
This change reverted in eac6f369 but it is needed for data integrity. See #25328.
-
由 Rafael Mendonça França 提交于
Revert "Merge pull request #27636 from mtsmfm/disable-referential-integrity-without-superuser-privilege-take-2" This reverts commit c1faca63, reversing changes made to 8c658a0e. See https://github.com/rails/rails/pull/27636#issuecomment-297534129
-
- 26 4月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Cannot call private methods in `@klass` against `CollectionProxy` (inherites `Relation`) because using `public_send` in `method_missing`.
-
- 22 4月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up of 03d3f036. Some of `respond_to?` were replaced to `respond_to_missing?` in 03d3f036. But the visibility is still public. It should be private.
-
- 21 4月, 2017 2 次提交
-
-
由 Isaac Betesh 提交于
Fixes #24032
-
由 Ryuta Kamizono 提交于
Prevent double firing the before save callback of new object when the parent association saved in the callback Related #18155, #26661, 268a5bb0, #27434, #27442, and #28599. Originally #18155 was introduced for preventing double insertion caused by the after save callback. But it was caused the before save issue (#26661). 268a5bb0 fixed #26661, but it was caused the performance regression (#27434). #27442 added new record to `target` before calling callbacks for fixing #27434. But it was caused double firing before save callback (#28599). We cannot add new object to `target` before saving the object. This is improving #18155 to only track callbacks after `save`. Fixes #28599.
-
- 20 4月, 2017 2 次提交
-
-
由 Fabian Schwahn 提交于
Add regression test for setting inverse instances on normal & polymorphic relationships when building objects on new records
-
由 Fabian Schwahn 提交于
This makes automatic inverse detection possible for polymorphic :has_one & :has_many possible. This resolves a number of issues, eg. `touch: true` on polymorphic relationships (#16446) and automatically setting inverse associations on newly built objects (#15028, #21843).
-
- 26 3月, 2017 2 次提交
-
-
由 Yasuo Honda 提交于
-
由 Fumiaki MATSUSHIMA 提交于
Re-create https://github.com/rails/rails/pull/21233 eeac6151 was reverted (127509c0) because it breaks tests. ---------------- ref: 72c15572 - We must use `authors` fixture with `author_addresses` because of its foreign key constraint. - Tests require PostgreSQL >= 9.4.2 because it had a bug about `ALTER CONSTRAINTS` and fixed in 9.4.2.
-
- 20 3月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Extension methods should not delegate to `scope` to respect dirty target on `CollectionProxy`. Fixes #28419.
-
- 19 3月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Since b644964b `ActiveRecord::Relation` includes `Enumerable` so delegating `collect`, `all?`, and `include?` are also unneeded. `collect` without block returns `Enumerable` without preloading by that. We should use `load` rather than `collect` for force loading.
-
- 17 3月, 2017 1 次提交
-
-
由 George Claghorn 提交于
Use it to specify that an association should be initialized with a particular record before validation. For example: # Before belongs_to :account before_validation -> { self.account ||= Current.account } # After belongs_to :account, default: -> { Current.account }
-