Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | add a specific factory method rather than using new | Aaron Patterson | 2013-07-23 | 4 | -5/+5 |
| | |||||
* | extract mutation from generation method | Aaron Patterson | 2013-07-23 | 1 | -1/+1 |
| | |||||
* | AR::Base does not need to know how to create reflection objects | Aaron Patterson | 2013-07-22 | 1 | -1/+1 |
| | |||||
* | remove unnecessary reader | Aaron Patterson | 2013-07-22 | 1 | -4/+4 |
| | |||||
* | only flatten one side | Aaron Patterson | 2013-07-22 | 1 | -1/+1 |
| | |||||
* | extend by adding relationships rather than monkey patching | Aaron Patterson | 2013-07-22 | 1 | -5/+7 |
| | |||||
* | decouple extensions from association object state | Aaron Patterson | 2013-07-22 | 1 | -2/+2 |
| | |||||
* | Revert "Merge pull request #11416 from tigrish/master" | Yves Senn | 2013-07-22 | 2 | -2/+2 |
| | | | | | This reverts commit 9dc8aef084fc5ae7e3a396dd098d89da93d06fda, reversing changes made to 02e8dae6279ea25312293a3eca777faf35139c4c. | ||||
* | Merge pull request #11416 from tigrish/master | Yves Senn | 2013-07-21 | 2 | -2/+2 |
|\ | | | | | Rename the I18n keys for associations' restrict_dependent_destroy errors | ||||
| * | Remove ambiguity with pluralizations and I18n keys used for association ↵ | Christopher Dell | 2013-07-13 | 2 | -2/+2 |
| | | | | | | | | restrict_dependent_destroy errors | ||||
* | | use the superclass implementation | Aaron Patterson | 2013-07-18 | 1 | -1/+1 |
| | | |||||
* | | parent_table is only used internally | Aaron Patterson | 2013-07-16 | 1 | -4/+4 |
| | | |||||
* | | decouple the manager class from building join constraints | Aaron Patterson | 2013-07-16 | 1 | -6/+6 |
| | | |||||
* | | cache the klass member of the reflection | Aaron Patterson | 2013-07-16 | 1 | -8/+10 |
| | | |||||
* | | cache the scope chain on the stack and eliminate `i` | Aaron Patterson | 2013-07-16 | 1 | -7/+4 |
| | | |||||
* | | just push on to the scope chain items. Oops! (thanks @carlosantoniodasilva) | Aaron Patterson | 2013-07-16 | 1 | -2/+1 |
| | | |||||
* | | use Relation#merge to combine scope chain items | Aaron Patterson | 2013-07-16 | 1 | -6/+6 |
| | | |||||
* | | make sure scope_chain_items has consistent types | Aaron Patterson | 2013-07-16 | 1 | -7/+9 |
|/ | |||||
* | #11288: Removed duplicated touching | Paul Nikitochkin | 2013-07-05 | 1 | -1/+1 |
| | | | | | | if belongs to model with touch option on touch Closes #11288 | ||||
* | Dropped deprecated option `:restrict` for `:dependent` in associations | Neeraj Singh | 2013-07-03 | 5 | -11/+4 |
| | |||||
* | Removed support for deprecated `delete_sql` in associations. | Neeraj Singh | 2013-07-03 | 2 | -16/+11 |
| | |||||
* | Removed support for deprecated `insert_sql` in associations. | Neeraj Singh | 2013-07-02 | 2 | -10/+6 |
| | |||||
* | fix indentation | Neeraj Singh | 2013-07-02 | 1 | -14/+14 |
| | |||||
* | Removed support for deprecated `finder_sql` in associations. | Neeraj Singh | 2013-07-02 | 3 | -41/+6 |
| | |||||
* | Removed support for deprecated `counter_sql` | Neeraj Singh | 2013-07-02 | 4 | -18/+14 |
| | |||||
* | Merge pull request #10604 from ↵ | Rafael Mendonça França | 2013-07-01 | 2 | -15/+31 |
|\ | | | | | | | | | | | | | | | | | neerajdotname/delete_all_should_not_call_callbacks Do not invoke callbacks when delete_all is called Conflicts: activerecord/CHANGELOG.md | ||||
| * | Do not invoke callbacks when delete_all is called | Neeraj Singh | 2013-06-30 | 2 | -15/+31 |
| | | | | | | | | | | | | | | | | | | | | | | Method `delete_all` should not be invoking callbacks and this feature was deprecated in Rails 4.0. This is being removed. `delete_all` will continue to honor the `:dependent` option. However if `:dependent` value is `:destroy` then the default deletion strategy for that collection will be applied. User can also force a deletion strategy by passing parameter to `delete_all`. For example you can do `@post.comments.delete_all(:nullify)` | ||||
* | | Removed deprecated options for assocations | Neeraj Singh | 2013-07-02 | 2 | -19/+0 |
| | | | | | | | | | | Deprecated options `delete_sql`, `insert_sql`, `finder_sql` and `counter_sql` have been deleted. | ||||
* | | Removed deprecated method scoped | Neeraj Singh | 2013-07-01 | 1 | -5/+0 |
| | | |||||
* | | don't shadow `through_scope` method name with local var. | Yves Senn | 2013-06-30 | 1 | -7/+7 |
|/ | |||||
* | Simplify/fix implementation of default scopes | Jon Leighton | 2013-06-28 | 4 | -9/+3 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation was necessary in order to support stuff like: class Post < ActiveRecord::Base default_scope where(published: true) scope :ordered, order("created_at") end If we didn't evaluate the default scope at the last possible moment before sending the SQL to the database, it would become impossible to do: Post.unscoped.ordered This is because the default scope would already be bound up in the "ordered" scope, and therefore wouldn't be removed by the "Post.unscoped" part. In 4.0, we have deprecated all "eager" forms of scopes. So now you must write: class Post < ActiveRecord::Base default_scope { where(published: true) } scope :ordered, -> { order("created_at") } end This prevents the default scope getting bound up inside the "ordered" scope, which means we can now have a simpler/better/more natural implementation of default scoping. A knock on effect is that some things that didn't work properly now do. For example it was previously impossible to use #except to remove a part of the default scope, since the default scope was evaluated after the call to #except. | ||||
* | Apply default scope when joining associations. | Jon Leighton | 2013-06-28 | 1 | -0/+2 |
| | | | | | | | | | | | | | | | | | | | For example: class Post < ActiveRecord::Base default_scope -> { where published: true } end class Comment belongs_to :post end When calling `Comment.join(:post)`, we expect to receive only comments on published posts, since that is the default scope for posts. Before this change, the default scope from `Post` was not applied, so we'd get comments on unpublished posts. | ||||
* | do not load all child records for inverse case | Neeraj Singh | 2013-06-21 | 1 | -1/+1 |
| | | | | | | | | | | | | | | currently `post.comments.find(Comment.first.id)` would load all comments for the given post to set the inverse association. This has a huge performance penalty. Because if post has 100k records and all these 100k records would be loaded in memory even though the comment id was supplied. Fix is to use in-memory records only if loaded? is true. Otherwise load the records using full sql. Fixes #10509 | ||||
* | Revert "Merge pull request #10566 from neerajdotname/10509d" | Jon Leighton | 2013-06-19 | 1 | -1/+1 |
| | | | | | | | | | | This reverts commit 2b817a5e89ac0e7aeb894a40ae7151a0cf3cef16, reversing changes made to 353a398bee68c5ea99d76ac7601de0a5fef6f4a5. Conflicts: activerecord/CHANGELOG.md Reason: the build broke | ||||
* | do not load all child records for inverse case | Neeraj Singh | 2013-06-19 | 1 | -1/+1 |
| | | | | | | | | | | | | | | currently `post.comments.find(Comment.first.id)` would load all comments for the given post to set the inverse association. This has a huge performance penalty. Because if post has 100k records and all these 100k records would be loaded in memory even though the comment id was supplied. Fix is to use in-memory records only if loaded? is true. Otherwise load the records using full sql. Fixes #10509 | ||||
* | `CollectionProxy#include?` returns `true` and `false` as documented. | Yves Senn | 2013-06-18 | 1 | -1/+1 |
| | |||||
* | Merge branch 'master' of github.com:lifo/docrails | Vijay Dev | 2013-06-14 | 1 | -3/+4 |
|\ | | | | | | | | | Conflicts: guides/source/upgrading_ruby_on_rails.md | ||||
| * | enhanced comments for foreign_key_present? method | Neeraj Singh | 2013-05-23 | 1 | -3/+4 |
| | | |||||
* | | bind values should not be merged between scopes | Aaron Patterson | 2013-06-11 | 1 | -1/+1 |
| | | |||||
* | | stop adding a new method for touch callbacks | Aaron Patterson | 2013-06-11 | 1 | -29/+21 |
| | | |||||
* | | push the touch method outside the eval | Aaron Patterson | 2013-06-11 | 1 | -13/+34 |
| | | |||||
* | | remove unused variable | Aaron Patterson | 2013-06-11 | 1 | -1/+0 |
| | | |||||
* | | check whether the association is constructible rather than checking constants | Aaron Patterson | 2013-06-11 | 1 | -3/+3 |
| | | |||||
* | | use attribute methods for finding key values rather than generating method names | Aaron Patterson | 2013-06-11 | 1 | -3/+3 |
| | | |||||
* | | push belongs_to counter cache method to a single method | Aaron Patterson | 2013-06-11 | 1 | -17/+18 |
| | | |||||
* | | push before_destroy counter cache method to a single method | Aaron Patterson | 2013-06-11 | 1 | -12/+17 |
| | | |||||
* | | remove evaled belongs_to counter cache method | Aaron Patterson | 2013-06-11 | 1 | -8/+22 |
| | | |||||
* | | adding callbacks should be private | Aaron Patterson | 2013-06-11 | 1 | -4/+6 |
| | | |||||
* | | remove evals from the association | Aaron Patterson | 2013-06-11 | 1 | -8/+2 |
| | | |||||
* | | reduce evals in depdendent associations | Aaron Patterson | 2013-06-11 | 1 | -1/+2 |
| | |