# Association preloading problems

**URL:** <https://www.ruby-forum.com/t/association-preloading-problems/127219>\
**Category:** Rails\
**Created:** [January 26, 2008, 1:20pm UTC](https://www.ruby-forum.com/t/association-preloading-problems/127219 "2008-01-26T13:20:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fcheung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/90db22/32.png) [@fcheung](https://www.ruby-forum.com/u/fcheung)\
**Post date:** [January 26, 2008, 1:20pm UTC](https://www.ruby-forum.com/t/association-preloading-problems/127219/1 "2008-01-26T13:20:49Z")

</div>

- first off there are some patches on  
[http://dev.rubyonrails.org/attachment/ticket/9640](http://dev.rubyonrails.org/attachment/ticket/9640)  
that look sane to me (and maybe have slipped under the radar because  
they weren’t in their own ticket).  
Secondly it has been very rightly pointed out that the  
include\_eager\_conditions? and include\_eager\_order? functions that  
preloading leans on to decide whether to fallback to the old eager  
loading code aren’t smart enough (specifically they understand  
other\_table.foo, but not `other_table`.`foos`).  
It’s not as completely straightforward as adding that to the regex  
(currently /([.\w]+).\w+/) since the change to be made obviously  
depends on how that particular database quotes table & column names.  
Anyone have a smart idea for generating the right regular expression ?  
perhaps lean on connection.quote\_table\_name and  
connection.quote\_column\_name to generate the right delimiters and then  
the expression is

Thoughts?

Fred

---

<div class="post-metadata">

**Author:** ![fcheung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/90db22/32.png) [@fcheung](https://www.ruby-forum.com/u/fcheung)\
**Post date:** [January 26, 2008, 1:41pm UTC](https://www.ruby-forum.com/t/association-preloading-problems/127219/2 "2008-01-26T13:41:22Z")

</div>

Oops, meant to post that to core.  
Move along, nothing to see 🙂

Fred
