Displaying 5 results from an estimated 5 matches for "joindependency".
2010 Oct 25
1
A few fixes to eager loading issues
...record-3-eager-loading-fail#ticket-5845-19. There''s a small issue in Rails 3 eager loading, and this ticket has an accompanying patch.
Sssociations that show up twice in a Relation chain like:
Article.includes(:comments).includes(:comments => :moderations)
will show up twice in the JoinDependency''s join_parts but only once in the query that gets run. This wreaks all kinds of fun havoc with the select statement that gets used in construct_relation_for_association_find, since it will try to select from both copies of the table.
One solution (the one I implemented in the patch) is to...
2008 Nov 12
5
dynamic condition for has_one and eager loading issue
...ation I
am getting the following error when doing a count. Seems that self is
not really my model class anymore.... Does anybody know how I can get
that up and running?
Thanks a lot in advance
NoMethodError (undefined method `account_id'' for
#<ActiveRecord::Associations::ClassMethods::JoinDependency::JoinAssociation:
0x4d5bf5c>):
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/associations.rb:1621:in `interpolate_sql''
(eval):1:in `interpolate_sql''
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/
active_record/associations.rb:1600:in...
2007 Dec 09
0
straight join in rails
...force an order using the STRAIGHT_JOIN statement,
but rails doesn''t really let you do it. Having to construct this query
manually (there are 4 joins) and still have a right format for eager
association loading wasn''t really an option.
I digged into ActiveRecord and modifying the JoinDependency class to
output "STRAIGHT_JOIN"s instead of "LEFT OUTER JOIN"s looked like too
much work too, so I decided to take a shorter route: intercept the
generated sql query, and replace SELECT with SELECT STRAIGHT_JOIN.
Here''s a monkey-patch (written against ActiveRecord 1.5....
2006 Oct 08
1
Two-way eager loading?
My problem is that I have two classes where the eager loading isn''t
working as well as I would hope...
Here are my two classes:
class Daynote < ActiveRecord::Base
belongs_to :userplace
class Userplace < ActiveRecord::Base
has_many :daynote, :dependent => true
When I show my userplaces, I want to get the associated daynotes with
them, so I am doing:
@userplace =
2010 Jul 08
25
Prepared SQL statements
Dear all great developers.
I wonder if there is any work being done or thoughts being shared
regarding prepared SQL statements.
Currently I am in heavy need of tuning SQL INSERTS that insert large
(3MB) images into blobs.
I am using rails 2.3.5 with postgres adapter and pg driver.
Any information would be appreciated.
Jarl
--
You received this message because you are subscribed to the