Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | pass the foreign table and class to the join_constraints method | Aaron Patterson | 2013-10-20 | 1 | -4/+1 | |
| | ||||||
* | pass the join type to the join_constraints method | Aaron Patterson | 2013-10-20 | 1 | -1/+1 | |
| | ||||||
* | stop reversing tables until we absolutely must | Aaron Patterson | 2013-10-15 | 1 | -2/+2 | |
| | ||||||
* | pass the chain the join_constraints | Aaron Patterson | 2013-10-15 | 1 | -2/+2 | |
| | ||||||
* | move column_names_with_alias on to the alias cache object | Aaron Patterson | 2013-10-14 | 1 | -5/+1 | |
| | ||||||
* | remove delegation to `chain` | Aaron Patterson | 2013-10-14 | 1 | -3/+1 | |
| | ||||||
* | rm JoinHelper from JoinAssociation | Aaron Patterson | 2013-10-14 | 1 | -3/+1 | |
| | ||||||
* | unhook `join_constraints` from the @tables ivar | Aaron Patterson | 2013-10-13 | 1 | -2/+2 | |
| | ||||||
* | remove delegate methods that are not used | Aaron Patterson | 2013-10-13 | 1 | -1/+1 | |
| | ||||||
* | pull parent and alias tacker from the nodes. | Aaron Patterson | 2013-10-11 | 1 | -9/+4 | |
| | | | | For now, we'll set the tables on the nodes manually. | |||||
* | decouple the `join_constraints` method from the parent pointer | Aaron Patterson | 2013-10-11 | 1 | -1/+1 | |
| | ||||||
* | stop creating a bunch of relation objects when we can slap all the joins on ↵ | Aaron Patterson | 2013-10-09 | 1 | -5/+0 | |
| | | | | at once | |||||
* | speed up match? | Aaron Patterson | 2013-10-09 | 1 | -0/+1 | |
| | ||||||
* | make node search more efficient | Aaron Patterson | 2013-10-09 | 1 | -0/+4 | |
| | | | | | | Rather than search every node in the tree, comparing that node and all of its parents every time, start at the root from both sides and work our way down the tree | |||||
* | remove == so we can see where walking up parents occurs | Aaron Patterson | 2013-10-09 | 1 | -6/+0 | |
| | ||||||
* | push parent up to the superclass | Aaron Patterson | 2013-10-09 | 1 | -6/+1 | |
| | | | | We always want a linked list back to the root node. | |||||
* | hide join_parts internals from other classes | Aaron Patterson | 2013-10-08 | 1 | -11/+0 | |
| | ||||||
* | decouple JoinAssociation from JoinDependency | Aaron Patterson | 2013-10-08 | 1 | -9/+4 | |
| | ||||||
* | Set the join type on construction | Aaron Patterson | 2013-10-03 | 1 | -2/+2 | |
| | | | | | We always set the join type immediately after construction, just make it part of the constructor and we can skip that step | |||||
* | simplify the JoinAssociation constructor, check validity *before* | Aaron Patterson | 2013-10-03 | 1 | -6/+0 | |
| | ||||||
* | parent is always passed in, so make it non-optional | Aaron Patterson | 2013-10-03 | 1 | -1/+1 | |
| | ||||||
* | require the files we need so the classes are stand-alone | Aaron Patterson | 2013-10-03 | 1 | -0/+2 | |
| | ||||||
* | remove HABTM special cases from associations classes | Aaron Patterson | 2013-10-02 | 1 | -11/+0 | |
| | ||||||
* | add a specific factory method rather than using new | Aaron Patterson | 2013-07-23 | 1 | -2/+2 | |
| | ||||||
* | 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 | |
| | ||||||
* | 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. | |||||
* | stop doing assingments in an iterator | Aaron Patterson | 2013-05-17 | 1 | -2/+6 | |
| | ||||||
* | rdoc for some of the methods in JoinDependency | Neeraj Singh | 2013-04-10 | 1 | -0/+15 | |
| | ||||||
* | While merging relations preserve context for joins | Jared Armstrong and Neeraj Singh | 2013-04-10 | 1 | -1/+6 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #3002. Also see #5494. ``` class Comment < ActiveRecord::Base belongs_to :post end class Author < ActiveRecord::Base has_many :posts end class Post < ActiveRecord::Base belongs_to :author has_many :comments end ``` `Comment.joins(:post).merge(Post.joins(:author).merge(Author.where(:name => "Joe Blogs"))).all` would fail with `ActiveRecord::ConfigurationError: Association named 'author' was not found on Comment`. It is failing because `all` is being called on relation which looks like this after all the merging: `{:joins=>[:post, :author], :where=>[#<Arel::Nodes::Equality: ....}`. In this relation all the context that `Post` was joined with `Author` is lost and hence the error that `author` was not found on `Comment`. Ths solution is to build JoinAssociation when two relations with join information are being merged. And later while building the arel use the previously built `JoinAssociation` record in `JoinDependency#graft` to build the right from clause. Thanks to Jared Armstrong (https://github.com/armstrjare) for most of the work. I ported it to make it compatible with new code base. | |||||
* | changed variable name active_record => base_klass | Neeraj Singh | 2013-04-09 | 1 | -1/+1 | |
| | | | | | | | | | | | | | | | | | Current code stores the klass name in active_record and this is used throughout. While reviewing the code time and again I had the mental picture of active_record being an instance of a klass. However here the actual klass is being stored in @active_record. Secondly at two different places while referring to @active_record the comment refers to it as base klass. All this points to active_record being not the best variable name. So I thought it is better to replace active_record with base_klass. This change is confined to JoinDependency, JoinBase, JoinPart and JoinAssociation - all joining related work. | |||||
* | not a relation. it's an arel select manager | Neeraj Singh | 2013-04-02 | 1 | -4/+4 | |
| | ||||||
* | Represent association scope options as AR::Relations insternally. | Jon Leighton | 2012-07-13 | 1 | -18/+15 | |
| | ||||||
* | Revert "Merge pull request #5494 from ↵ | Jon Leighton | 2012-05-05 | 1 | -6/+1 | |
| | | | | | | | armstrjare/active_record_relation_keep_association_join_context_on_merge" This reverts commit dcd04e76179611a9db28c9e391aa7d6c2a5b046a, reversing changes made to 58a49875df63729f07a9a81d1ee349087d258df5. | |||||
* | Allow ActiveRecord::Relation merges to maintain context of joined associations | Jared Armstrong | 2012-05-04 | 1 | -1/+6 | |
| | ||||||
* | Avoid sanitize_sql when we can use Relation#where instead | Jon Leighton | 2012-01-16 | 1 | -2/+5 | |
| | ||||||
* | Fix problem with loading polymorphic associations which have been defined in ↵ | Jon Leighton | 2011-05-22 | 1 | -3/+7 | |
| | | | | an abstract superclass. Fixes #552. | |||||
* | Add join conditions to JOIN clause, not WHERE | Ernie Miller | 2011-05-05 | 1 | -3/+3 | |
| | ||||||
* | Extract the constraint-building for joins in JoinAssociation into a separate ↵ | Jon Leighton | 2011-04-14 | 1 | -8/+14 | |
| | | | | method to make it easy to change/override (requested by Ernie Miller so that MetaWhere can add to it easily) | |||||
* | Fix tests under postgres - we should always put conditions in the WHERE part ↵ | Jon Leighton | 2011-03-12 | 1 | -8/+11 | |
| | | | | not in ON constraints because postgres requires that the table has been joined before the condition references it. | |||||
* | Abstract some common code from AssociationScope and ↵ | Jon Leighton | 2011-03-11 | 1 | -53/+12 | |
| | | | | JoinDependency::JoinAssociation into a JoinHelper module | |||||
* | Refactor JoinAssociation | Jon Leighton | 2011-03-10 | 1 | -100/+54 | |
| | ||||||
* | Rename Reflection#through_reflection_chain and #through_options to ↵ | Jon Leighton | 2011-03-10 | 1 | -9/+7 | |
| | | | | Reflection#chain and Reflection#options as they now no longer relate solely to through associations. | |||||
* | Use Base#type_condition in JoinAssociation | Jon Leighton | 2011-03-05 | 1 | -15/+4 | |
| | ||||||
* | Push source_type and polymorphic conditions out of ThroughAssociation and ↵ | Jon Leighton | 2011-03-05 | 1 | -18/+0 | |
| | | | | JoinDependency::JoinAssociation and into the reflection instead. |