- 18 8月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
Currently `CollectionProxy` inherits `Relation` and `Relation` includes `QueryMethods`. This method is completely duplicated. https://github.com/rails/rails/blob/v5.0.0/activerecord/lib/active_record/relation/query_methods.rb#L271-L275
-
- 16 8月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
`#second`, `#third`, etc finder methods was added in 03855e79. But the signature of these methods is inconsistent with the original finder methods. And also the signature of `#first` and `#last` methods is different from the original. This commit fixes the inconsistency.
-
- 14 8月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
`#first`, `#second`, ..., `#last` methods respects dirty target. But `#take` doesn't respect it. This commit fixes the inconsistent behavior.
-
- 08 8月, 2016 1 次提交
-
-
由 Xavier Noria 提交于
Some case expressions remain, need to think about those ones.
-
- 07 8月, 2016 2 次提交
-
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
-
- 03 8月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
Because `scope` (`target_scope`) is a `AssociationRelation`. `AssociationRelation` handles `set_inverse_instance`. https://github.com/rails/rails/blob/v5.0.0/activerecord/lib/active_record/association_relation.rb#L31-L33 See also #26022.
-
- 02 8月, 2016 1 次提交
-
-
由 Ryuta Kamizono 提交于
Because `scope` (`target_scope`) is a `AssociationRelation`. `AssociationRelation` handles `set_inverse_instance`. https://github.com/rails/rails/blob/v5.0.0/activerecord/lib/active_record/association_relation.rb#L31-L33
-
- 21 5月, 2016 1 次提交
-
-
由 Jon Moss 提交于
[ci skip]
-
- 19 5月, 2016 1 次提交
-
-
由 Jeremy Daer 提交于
Ruby 2.4 unifies Fixnum and Bignum into Integer: https://bugs.ruby-lang.org/issues/12005 * Forward compat with new unified Integer class in Ruby 2.4+. * Backward compat with separate Fixnum/Bignum in Ruby 2.2 & 2.3. * Drops needless Fixnum distinction in docs, preferring Integer.
-
- 20 3月, 2016 1 次提交
-
-
由 Erik Michaels-Ober 提交于
-
- 11 2月, 2016 1 次提交
-
-
由 Brian Christian 提交于
-
- 10 2月, 2016 1 次提交
-
-
由 Brian Christian 提交于
-
- 03 2月, 2016 1 次提交
-
-
由 Himesh 提交于
Changed id-writer to save join table records based on association primary key
-
- 23 11月, 2015 1 次提交
-
-
由 Bogdan Gusiev 提交于
When same association is loaded in the model creation callback The new object is inserted into association twice
-
- 20 10月, 2015 1 次提交
-
-
由 yui-knk 提交于
When `require 'active_support/rails'`, 'active_support/deprecation' is automatically loaded.
-
- 13 8月, 2015 1 次提交
-
-
由 Rafael Mendonça França 提交于
If the through class has default scopes we should skip the statement cache. Closes #20745.
-
- 03 8月, 2015 1 次提交
-
-
由 Mehmet Emin İNAÇ 提交于
Fixes #21082 remove extra space
-
- 16 7月, 2015 1 次提交
-
-
由 Prem Sichanugrist 提交于
This is to simplify the association API, as you can call `reload` on the association proxy or the parent object to get the same result. For collection association, you can call `#reload` on association proxy to force a reload: @user.posts.reload # Instead of @user.posts(true) For singular association, you can call `#reload` on the parent object to clear its association cache then call the association method: @user.reload.profile # Instead of @user.profile(true) Passing a truthy argument to force association to reload will be removed in Rails 5.1.
-
- 04 4月, 2015 1 次提交
-
-
由 Shintaro Kojima 提交于
When replacing a has_many association with the same one, there is nothing to do with database but a setter method should still return the substituted value for backward compatibility.
-
- 16 3月, 2015 1 次提交
-
-
由 Ben Woosley 提交于
When a new record has the necessary information prior to save, we can avoid busting the cache. We could simply clear the @proxy on #reset or #reset_scope, but that would clear the cache more often than necessary.
-
- 12 3月, 2015 1 次提交
-
-
由 Ben Woosley 提交于
Instead use .scope_attributes? consistently in ActiveRecord to check whether there are attributes currently associated with the scope. Move the implementation of .scope_attributes? and .scope_attributes to ActiveRecord::Scoping because they don't particularly have to do specifically with Named scopes and their only dependency, in the case of .scope_attributes?, and only caller, in the case of .scope_attributes is contained in Scoping.
-
- 28 2月, 2015 1 次提交
-
-
由 Akira Matsuda 提交于
-
- 21 2月, 2015 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 18 2月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
-
- 13 2月, 2015 1 次提交
-
-
由 Eugene Gilburg 提交于
Use SQL COUNT and LIMIT 1 queries for none? and one? methods if no block or limit is given, instead of loading the entire collection to memory. The any? and many? methods already follow this behavior. [Eugene Gilburg & Rafael Mendonça França]
-
- 27 1月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
There are many ways that things end up getting passed to `concat`. Not all of those entry points called `flatten` on their input. It seems that just about every method that is meant to take a single record, or that splats its input, is meant to also take an array. `concat` is the earliest point that is common to all of the methods which add records to the association. Partially fixes #18689
-
- 02 1月, 2015 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 26 12月, 2014 1 次提交
-
-
由 Vipul A M 提交于
-
- 29 11月, 2014 1 次提交
-
-
由 Erik Michaels-Ober 提交于
-
- 26 11月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
The records weren't being replaced since equality in Active Record is defined in terms of `id` only. It is reasonable to expect that the references would be replaced in memory, even if no queries are actually executed. This change did not appear to affect any other parts of the code base. I chose not to execute callbacks since we're not actually modifying the association in a way that will be persisted. Fixes #17730
-
- 21 11月, 2014 1 次提交
-
-
由 claudiob 提交于
I grepped the source code for code snippets wrapped in backticks in the comments and replaced the backticks with plus signs so they are correctly displayed in the Rails documentation. [ci skip]
-
- 08 11月, 2014 1 次提交
-
-
由 Aaron Patterson 提交于
if you specify a default scope on a model, it will break caching. We cannot predict what will happen inside the scope, so play it safe for now. fixes #17495
-
- 15 10月, 2014 1 次提交
-
-
由 Aaron Patterson 提交于
follow up for #17052
-
- 03 10月, 2014 1 次提交
-
-
由 Ben Woosley 提交于
Fix that a collection proxy could be cached before the save of the owner, resulting in an invalid proxy lacking the owner’s id. Absent this fix calls like: owner.association.update_all to behave unexpectedly because they try to act on association objects where owner_id is null. more evidence here: https://gist.github.com/Empact/5865555 ``` Active Record 3.2.13 -- create_table(:firms, {:force=>true}) -> 0.1371s -- create_table(:clients, {:force=>true}) -> 0.0005s 1 clients. 1 expected. 1 clients updated. 1 expected. ``` ``` Active Record 4.0.0 -- create_table(:firms, {:force=>true}) -> 0.1606s -- create_table(:clients, {:force=>true}) -> 0.0004s 1 clients. 1 expected. 0 clients updated. 1 expected. ```
-
- 04 9月, 2014 1 次提交
-
-
由 Sammy Larbi 提交于
Eagerly loaded collection and singular associations are ignored by the StatementCache, which causes errors when the queries they generate reference columns that were not eagerly loaded. This commit skips the creation of the StatementCache as a fix for these scenarios.
-
- 18 6月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
-
- 10 6月, 2014 1 次提交
-
-
由 Sean Griffin 提交于
In some cases there is a difference between the two, we should always be doing one or the other. For convenience, `type_cast` is still a private method on type, so new types that do not need different behavior don't need to implement two methods, but it has been moved to private so it cannot be used accidentally.
-
- 18 5月, 2014 1 次提交
-
-
由 eileencodes 提交于
When delete or destroy is called on all records nothing is deleted or destroyed. Intead of running through the code and still not deleteing anything, we should early return
-
- 14 5月, 2014 1 次提交
-
-
由 eileencodes 提交于
Rename delete_all_records because this name better describes what the method is doing. We can then remove :all from the hm:t version and pull out the unoptimized call to load_target in delete_records and pass it directly.
-