aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/join_dependency/join_part.rb
Commit message (Collapse)AuthorAgeFilesLines
* Avoid unneeded expanded column aliases array cachingRyuta Kamizono2018-07-101-2/+2
|
* Ensure to calculate column aliases after all table aliases are constructedRyuta Kamizono2018-06-191-0/+7
| | | | | | | | | | | | | | | | | Currently, column aliases which is used for eager loading are calculated before constructing all table aliases in FROM clause. `JoinDependency#join_constraints` constructs table aliases for `joins` first, and then always re-constructs table aliases for eager loading. If both `joins` and eager loading are given a same table association, the re-construction would cause the discrepancy between column aliases and table aliases. To avoid the discrepancy, the column aliases should be calculated after all table aliases are constructed. Fixes #30603.
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Remove useless `aliased_table_name` in `JoinDependency`Ryuta Kamizono2017-07-151-5/+0
| | | | If `table.table_alias` is not nil, it is enough to use `table` simply.
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Remove unused `JoinPart#name`Ryuta Kamizono2017-05-221-4/+0
|
* Ensure that inverse associations are set before running callbacksSean Griffin2016-08-311-2/+2
| | | | | | | | | | | | | | | | | If a parent association was accessed in an `after_find` or `after_initialize` callback, it would always end up loading the association, and then immediately overwriting the association we just loaded. If this occurred in a way that the parent's `current_scope` was set to eager load the child, this would result in an infinite loop and eventually overflow the stack. For records that are created with `.new`, we have a mechanism to perform an action before the callbacks are run. I've introduced the same code path for records created with `instantiate`, and updated all code which sets inverse instances on newly loaded associations to use this block instead. Fixes #26320.
* modernizes hash syntax in activerecordXavier Noria2016-08-061-1/+1
|
* Remove defunct ivarsBen Woosley2014-09-281-1/+0
| | | | @column_names_with_alias, @dynamic_methods_hash, @time_zone_column_names, and @cached_time_zone
* build the association graph functionallyAaron Patterson2013-10-211-2/+2
| | | | This lets us avoid the constant calls to Array#<<
* Merge branch 'master' into joindepAaron Patterson2013-10-151-1/+1
|\ | | | | | | | | | | | | | | | | | | | | * master: use the cached arel table Fix typo in the changelog entry Don't remove the select values to add they back again Pluck on NullRelation accepts a list of columns Conflicts: activerecord/lib/active_record/relation/finder_methods.rb
| * use the cached arel tableAaron Patterson2013-10-151-1/+1
| |
* | move column_names_with_alias on to the alias cache objectAaron Patterson2013-10-141-20/+3
| |
* | keep a cache on the alias objectAaron Patterson2013-10-141-5/+0
| |
* | move alias building to the table nodeAaron Patterson2013-10-141-4/+0
| |
* | push the node->AR cache up one levelAaron Patterson2013-10-131-6/+1
| |
* | pull parent and alias tacker from the nodes.Aaron Patterson2013-10-111-6/+1
|/ | | | For now, we'll set the tables on the nodes manually.
* no reason to do this column addition and subtraction businessAaron Patterson2013-10-111-1/+1
|
* refactor a little so we can remove some methodsAaron Patterson2013-10-101-3/+0
|
* delete unused codeAaron Patterson2013-10-101-10/+0
| | | | | Now that we merge trees from the top down, we don't need to search through the whole tree for particular nodes, just walk it and merge.
* simplify each method.Aaron Patterson2013-10-101-8/+2
| | | | Stop writing terrible code Aaron. This is Ruby, not Scheme
* add some convenient methods for avoiding array allocationsAaron Patterson2013-10-091-0/+3
|
* make node search more efficientAaron Patterson2013-10-091-0/+14
| | | | | | 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 occursAaron Patterson2013-10-091-4/+0
|
* push parent up to the superclassAaron Patterson2013-10-091-1/+6
| | | | We always want a linked list back to the root node.
* convert JoinBase to a tree and remove the Node classAaron Patterson2013-10-091-1/+19
|
* don't access the reflections hashAaron Patterson2013-10-081-1/+1
| | | | The reflections hash is supposed to be private, so let's use the API.
* WhitespacesRafael Mendonça França2013-09-111-1/+2
|
* Reduce allocations when extracting AR modelsSam2013-09-111-1/+13
|
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2013-04-111-1/+1
|\ | | | | | | | | Conflicts: guides/source/action_mailer_basics.md
| * JoinPart is no longer an abstract classNeeraj Singh2013-04-081-1/+1
| |
* | changed variable name active_record => base_klassNeeraj Singh2013-04-091-5/+5
|/ | | | | | | | | | | | | | | | | 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.
* No need to send public methodsAkira Matsuda2013-02-261-1/+1
|
* Fix eagerly loading associations without primary keysKelley Reynolds2012-02-091-1/+1
|
* TableAlias leg ordering has changed, so change accordinglyAaron Patterson2011-03-301-1/+1
|
* Move JoinDependency and friends from ↵Jon Leighton2011-02-281-0/+78
ActiveRecord::Associations::ClassMethods to just ActiveRecord::Associations