Displaying 20 results from an estimated 10000 matches similar to: "Patch Review for selective joining of eager-loaded tables in pre-query"
2008 Feb 25
6
Review Request for Significant Performance Improvement in ActiveRecord
I''m going through my old tickets, and I found an outstanding ticket
that I''ve put many hours into, and is absolutely critical for a
production project that I''m now updating to Rails 2.0.2. The ticket:
http://dev.rubyonrails.org/ticket/9560
This comes on the tail of:
http://dev.rubyonrails.org/ticket/9497
Which I believed to be the superior improvement due to a very
2007 Jul 06
4
JOINS clobbering ids or other fields.
I just found this ticket because I noticed the same issue.
http://dev.rubyonrails.org/ticket/6251
The official response was that it''s not a bug because when you use
:joins you are "riding close to the metal". But I''m at a loss as to
figure out why this behavior even needs to exist.
Every table (except HABTM links) in a typical Rails app is going to
have an id
2008 Jan 05
0
Patch Review #10712: Auto Complete Option
I''ve posted a patch for support the AutoCompleter updateElement option
allowing the auto_complete plugin to customize the behavior of the
auto completion. I required this to fix my app and it is deployed in
production. Patch is dead simple and should be a quick sign off for
anyone using the plugin.
--
Gabe da Silveira
http://darwinweb.net
2008 Sep 16
3
has_one :through eager-loading problem
I have a problem with the :include option in find for my
has_one :through association.
I have Users, Profiles and Customers, all connected to each other with
a has_one :through => :membership association like this:
class Profile < ActiveRecord::Base #could also be user or customer
has_one :membership # i saw an acrticle of Ryan about
has_one :through, there this would be has_many, is
2007 Jun 25
0
Announcing Multisite Plugin for Rails 2.0
I''ve been working on this for a while, and gotten interest from
several people, so I''m posting an announcement here. Building on the
work of John Long''s multiple controller view paths in Rails core, I''ve
created a plugin for customizing templates on a per-site basis for a
single Rails app.
I also want to credit Matt McCray (and Tobias Lütke in turn) for his
2009 Oct 08
6
Eager Loading a Relationship That Has No PK/FK
I''m attempting to wrestle an old DB into Rails.
This relationship is giving me trouble:
class Show < AR::Base
has_many :segments
end
class Segment < AR::Base
belongs_to :show
has_one :media #this has no PK/FK relation
end
A Segment is "linked" to Media by Media.name, which is the result of
concatenating Segment.name and Segment.part. As I said there are is no
2008 May 05
1
eager loading has_one fix
I believe I have fixed the issue Trever noted with has_one (http://rails.lighthouseapp.com/projects/8994/tickets/64-eager-loading-inconsistency
) if people would like o have a look.
Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2008 Nov 12
5
dynamic condition for has_one and eager loading issue
Hi,
I ve defined the following relation in one of my models with a dynamic
where condition:
has_one :selection,
:foreign_key => ''object_id'',
:conditions => ''selection_type = 1 and account_id = #
{self.send(:account_id)}''
That works perfect, however when I try to eager load that relation I
am getting the following error when doing a
2005 Apr 27
5
Eager load mysteriously deletes records
Hi
This looks like a bug in ActiveRecord.
I am messing with eager loading (on 12.1) and all of a sudden records
started disappearing from a table (and I am not doing anything delete
related)!!
The following line works OK:-
@todos = Todo.find(:all, :include => [ :whens],:order => "position ASC")
The following line is mysteriously deleteing :where rows from the DB
after
2005 Jul 14
1
Single-table inheritance and eager loading
I have a people table with four types of people: clients, spouses,
children, and others all setup using single-table inheritance with a
foreign key back to a household record.
A Household has_one client and spouse, and has_many children and
others. I want to use a single "Household.find(@session
[:household_id], :include => [:client, :spouse, :children, :others])"
2007 Jul 06
0
Test XML Documents Using assert_select
Have you ever wanted to test your API output without those pesky
assert_select error messages? Well now you can!
http://dev.rubyonrails.org/ticket/8173
The patch has been sitting there quietly with no comment for a couple
months now. I think it should be pretty easy to apply. It won''t
affect standard HTML output or even XHTML given IE''s inability
understand the standard
2005 Aug 04
1
Pagination and :include (eager associations)
I have tried to use eager association with pagination, but
the :include option is not supported:
Here''s the one-line pagination call without :include
@link_pages, @links = paginate :link, :per_page => 10, :order_by
=> sort_clause
and here the work around, using the "classic" method
# @link_pages = Paginator.new self, Link.count, 10,
2006 Mar 02
3
Left Joins with Rails?
Everyone,
I have two tables (assuming their most logical types):
apartments
id
address
bedrooms
bathrooms
googlemaps_id
googlemaps
id
url
the models:
class Apartment < ActiveRecord::Base
has_one :googlemap
end
class Googlemap < ActiveRecord::Base
belongs_to :listing
end
I would like to find_all by searching the attributes in apartment, and
also return the google map
2006 Jan 19
0
Limited eager loads and conditions on the eager tables
Hi,
Why are limited eager loads and conditions on the eager tables incompatible?
Doing a find(:all) without :include causes a select * query to be generated,
which means the id fields everwrite each other if associated tables are
included using :joins.
But using :include, if conditions are placed on the tables listed in :joins
then Rails throws an exception when :limit is included too.
2008 Jan 11
0
Request for review of STI/eager-loading patch
Hi,
Review would be appreciated on this patch which stops
find returning incorrect results when multi-level STI
models are eagerly loaded:
http://dev.rubyonrails.org/ticket/10624
--
We develop, watch us RoR, in numbers too big to ignore.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2009 Mar 25
11
ActiveRecord: Nested :include erroneous behavior
Hi,
Found a simple example breaking on moving to 2.2 from 2.0. This
example illustrates the usage of nested :include finder options.
class Book < ActiveRecord::Base
has_many :distributors
end
class Distributor < ActiveRecord::Base
belongs_to :book
has_many :agents
end
class Agent < ActiveRecord::Base
belongs_to :distributor
has_many :shops
end
class Shop <
2006 Sep 03
1
New Technique: Subsets of has_many Associations
I just now thought of this, and sure enough it works like a charm (at
least so far in my limited testing):
has_many :events, :dependent => :delete_all
has_many :upcoming_events, :class_name => "Event", :conditions =>
"date > NOW()"
The purpose of this is that it makes eager loading of subsets of
associations possible without replacing all the magic of the
2006 Aug 16
1
using :select with :include to limit eager loading
Activerecord''s find option `:select'' does not appear to work when
:include is used to eager load associations. However, I sometimes want
to perform ready-made joins on associations to limit the results of a
query. here''s a simple example:
table university:
STRING code
INT id
table term:
STRING name
INT university_id
INT id
the associations of the models
2006 Aug 16
5
Rails theory question, where to put a join query
The is something I wrestle with a bit when I construct joined queries..
Perhaps some experienced insight will straighten this out for me.
Say you have two tables with two models, ''authors'' and ''posts''.
an author has_many posts, a post has_one author.
You need methods to do the following queries:
find_author(postid)
find_posts(authorid)
And you are doing a
2009 Mar 11
12
Eager loading comments associated with user submissions.
Hey everyone,
I am working on an application that allows users to submit articles,
and also comment on those articles. Pretty much exactly like Digg.
Everything works fine except that when there are a lot of comments
there are a lot of database queries to both fetch the comments and the
users who posted those comments. I have used eager loading in other
parts of my application to reduce the