- first off there are some patches on 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 /#{table_delimiter}?([\.\w]+)#{table_delimiter}?\.#{column_delimiter}? \w+#{column_delimiter}/ Or is that an oversimplification of quoting ? Thoughts? Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Jan 27, 2008 1:39 AM, Frederick Cheung <frederick.cheung@gmail.com> wrote:> > - first off there are some patches on 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).It''s probably best if the original ticket is closed and someone opens a new-rationalised patch with the changes rolled into one diff. The feature is in edge now, so these are bugs.> /#{table_delimiter}?([\.\w]+)#{table_delimiter}?\.#{column_delimiter}? > \w+#{column_delimiter}/ > > Or is that an oversimplification of quoting ?I think [Some table Name] is a method of quoting used by sql server?> Thoughts?Inspecting the :conditions hash is kinda nice, from a usability point of view as it makes the feature ''drop in''. But it''s probably a very difficult thing to get right consistently, perhaps it''s worth just immediately turning it off if there''s a :conditions or :order, but providing a :preload=>true argument to find to make it work? -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---