Hi, I have a bit of code like so: @city = City.find(params[:id]) @event_pages, @events = paginate :events, :per_page => 10, :joins => ["inner join locations on events.location_id = locations.id"], :conditions => ["locations.city_id = ?", @city.id] Strangely, when I want to list @events, everything seems to be working fine, but the event objects are getting the id of location instead of the event. The rest of the event columns/attributes are getting the right values. Only id happens to be from the respective location! I'm confused. Looks like a rails bug, any hints? TIA, Vamsee.
on 2007-07-21 00:29
on 2007-07-21 03:00
add :select => 'events.*' ActiveRecord does a SELECT * by default. On 7/20/07, vamsee <firstname.lastname@example.org> wrote: > > > > -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.com
on 2007-07-21 18:49
Rick Olson wrote: > add :select => 'events.*' > > ActiveRecord does a SELECT * by default. > D'oh. I should have tried that. Thanks, it works. Vamsee.