- 08 5月, 2014 1 次提交
-
-
由 Fred Wu 提交于
HABTM should fall back to using the normal CollectionAssociation's size calculation if the collection is not cached or loaded. This addresses both #14913 and #14914 for master.
-
- 07 5月, 2014 1 次提交
-
-
由 Jon Atack 提交于
Rewrite to avoid 'we'/'you', add missing period, and keep lines at 80 chars. Cheers :) Improve readability with help from @senny [ci skip]
-
- 06 5月, 2014 3 次提交
-
-
由 Fred Wu 提交于
-
由 eileencodes 提交于
Now that delete_all with destroy or delete_all dependency behave the same we no longer need this conditional. This means we can remove the new delete_all_with_dependency method I added and go straight to delete_records from delete_all, passing :all and the dependent directly.
-
由 Eric Chahin 提交于
Added #join_id_for(owner) to reflection to avoid accessing the source_macro
-
- 29 4月, 2014 4 次提交
-
-
由 eileencodes 提交于
Nullify (or nil dependency) was doing the same thing delete_all was doing in issue #14546, creating a large IN statement if the association was loaded. Loaded and not loaded associations should behave the same. The IN statement is also not great because it's inefficient.
-
由 eileencodes 提交于
After reviewing this code I realized the conditional that was there previously was basically saying if the dependency is not delete all. This is a better, cleaner, and clearer way to write this method.
-
由 eileencodes 提交于
Now that we have a new method delete_all_with_dependency this coupled conditional is no longer needed.
-
由 eileencodes 提交于
The delete method is very coupled with delete all even though only a portion of the conditionals apply. Decoupling this will make the code easier to understand and manipulate.
-
- 26 4月, 2014 1 次提交
-
-
由 Kassio Borges 提交于
When used a custom join_table name on a habtm, rails was not saving it on Reflections. This causes a problem when rails loads fixtures, because it uses the reflections to set database with fixtures.
-
- 25 4月, 2014 1 次提交
-
-
由 Yves Senn 提交于
/cc @tenderlove
-
- 23 4月, 2014 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 22 4月, 2014 2 次提交
-
-
由 Aaron Patterson 提交于
-
由 Earl J St Sauver 提交于
Fixes #14752 Select mimics the block interface of arrays, but does not mock the block interface for select!. This change moves the api to be a private method, _select!.
-
- 16 4月, 2014 2 次提交
-
-
由 Jean Boussier 提交于
-
由 Aaron Patterson 提交于
-
- 15 4月, 2014 3 次提交
-
-
由 Aaron Patterson 提交于
SQL statements for querying associations are now cached
-
由 Jean Boussier 提交于
-
由 Jean Boussier 提交于
-
- 14 4月, 2014 3 次提交
-
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Jean Boussier 提交于
-
- 08 4月, 2014 1 次提交
-
-
由 eileencodes 提交于
Passing in a blank string is a bug so there's no reason to check for a blank string.
-
- 07 4月, 2014 1 次提交
-
-
由 eileencodes 提交于
This method no longer returns an array of all records that have been removed. Correct documentation to reflect this change. See issue 14546
-
- 04 4月, 2014 1 次提交
-
-
由 Jan Habermann 提交于
-
- 03 4月, 2014 3 次提交
-
-
由 Jan Habermann 提交于
-
由 Jan Habermann 提交于
-
由 Jefferson Lai 提交于
CollectionProxy should be able to reuse the behavior (methods) of its parent class, but with its own state. This change allows CollectionProxy to use the arel object corresponding to its association's scope.
-
- 01 4月, 2014 1 次提交
-
-
由 eileencodes 提交于
When delete_all is run on a CollectionProxy and has a dependency of delete_all the SQL that is produced has an IN statement. (DELETE FROM `associated_model` where `associated_model` .`parent_id` = 1 AND `associated_model`.`id` IN (1, 2, 3...)). This only happens if the association is not loaded (both loaded and non-loaded delete_all should behave the same. This is a huge problem when it comes to deleting many records because the query becomes very slow. Instead the SQL produced should be (DELETE FROM `assoicated_model` where `associated_model`.`parent_model_id`=1). I fixed this by making sure the check for loaded and destroy also makes sure that the dependent is not delete_all, so the conditional goes to the else and deletes the records directly without the IN statement.
-
- 31 3月, 2014 2 次提交
-
-
由 thedarkone 提交于
The new method relies on AR::Associations::Association knowing about both reflection and a model class. AR::Base#association now raises a descriptive error when trying to access non-existent associations. Previously it would blow up with a confusing NoMethodError: undefined method `association_class' for nil:NilClass.
-
由 thedarkone 提交于
Defer to Association#klass instead of having a custom/duplicate code.
-
- 14 3月, 2014 3 次提交
-
-
由 Carlos Antonio da Silva 提交于
-
由 Aaron Patterson 提交于
Pass the id of the object to the method by calling `.id` on the AR object.
-
由 Aaron Patterson 提交于
Apparently we've been using a buggy feature for the past 6 years: https://bugs.ruby-lang.org/issues/9593
-
- 04 3月, 2014 1 次提交
-
-
由 Erik Michaels-Ober 提交于
-
- 01 3月, 2014 1 次提交
-
-
由 Arthur Neves 提交于
When replacing a has_many association with the same one, there is no need to do a round-trip to the db to create/and drop a new transaction. [fixes #14220]
-
- 26 2月, 2014 1 次提交
-
-
由 Aaron Patterson 提交于
`before_add` callbacks are fired before the record is saved on `has_and_belongs_to_many` assocations *and* on `has_many :through` associations. Before this change, `before_add` callbacks would be fired before the record was saved on `has_and_belongs_to_many` associations, but *not* on `has_many :through` associations. Fixes #14144
-
- 22 2月, 2014 1 次提交
-
-
由 Matt Jones 提交于
This allows the default scope to be built using the current table alias. Resolves #12770
-
- 21 2月, 2014 1 次提交
-
-
由 Wojtek Kruszewski 提交于
-
- 20 2月, 2014 1 次提交
-
-
由 Arthur Neves 提交于
This reverts commit f9e4c3c7. [fixes #14116]
-