I need SQL : SELECT `activities`.* FROM `activities` INNER JOIN `friendships` ON `activities`.user_id = `friendships`.friend_id WHERE `friendships`.user_id = 1 My User Model code: has_many :friendships, :dependent => :destroy has_many :friends, :through => :friendships has_many :activities ############################## has_many :friends_activities, :foreign_key => :user_id, :class_name => ''Activity'', :through => :friendships, :source => :friend Rails3 return: ON `activities`.id = `friendships`.friend_id ??! :foreign_key is ignored Why ?!!!! -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Aug 19, 10:17 am, Howl Wong <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I need SQL : > > SELECT `activities`.* FROM `activities` INNER JOIN `friendships` ON > `activities`.user_id = `friendships`.friend_id WHERE > `friendships`.user_id = 1 > > My User Model code: > > has_many :friendships, :dependent => :destroy > has_many :friends, :through => :friendships > has_many :activities > ############################## > has_many :friends_activities, :foreign_key => :user_id, :class_name => > ''Activity'', :through => :friendships, :source => :friend > > Rails3 return: > > ON `activities`.id = `friendships`.friend_id ??! :foreign_key is > ignored > > Why ?!!!!With has many through you use the :source option to tell it which of the associations of friendships to follow to get to the desired row(s) Fred> -- > Posted viahttp://www.ruby-forum.com/.-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung wrote:> With has many through you use the :source option to tell it which of > the associations of friendships to follow to get to the desired row(s) > > FredNow~ I need `activities`.user_id not is `activities`.id :D -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
VTD-XML 2.9, the next generation XML Processing API for SOA and Cloud computing, has been released. Please visit https://sourceforge.net/projects/vtd-xml/files/ to download the latest version. a.. Strict Conformance a.. VTD-XML now fully conforms to XML namespace 1.0 spec b.. Performance Improvement a.. Significantly improved parsing performance for small XML files c.. Expand Core VTD-XML API a.. Adds getPrefixString(), and toNormalizedString2() d.. Cutting/Splitting a.. Adds getSiblingElementFragment() e.. A number of bug fixes and code enhancement including: a.. Fixes a bug for reading very large XML documents on some platforms b.. Fixes a bug in parsing processing instruction c.. Fixes a bug in outputAndReparse() -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Jimmy Zhang wrote:> VTD-XML 2.9, the next generation XML Processing API for SOA and Cloud > computing, has been released.[...] Please don''t hijack threads. And this is off topic anyway. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Aug 20, 3:31 am, Howl Wong <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Frederick Cheung wrote: > > With has many through you use the :source option to tell it which of > > the associations of friendships to follow to get to the desired row(s) > > > Fred > > Now~ I need `activities`.user_id not is `activities`.id :DThen you need to change the source association to point at what you want (i think belongs_to has a primary_key option these days) Fred> > -- > Posted viahttp://www.ruby-forum.com/.-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.