search for: associated_foreign_key

Displaying 3 results from an estimated 3 matches for "associated_foreign_key".

2009 Jan 04
3
Table associated problem using belongs_to
...`packages`.`name` AS t0_r1, `packages`.`user_name` AS t0_r2, `users`.`id` AS t1_r0, `users`.`name` AS t1_r1, `users`.`full_name` AS t1_r2 FROM `packages` LEFT OUTER JOIN `users` ON `users`.id = `packages`.user_name WHERE (`packages`.`id` = 1) But I cannot find the parameters for belongs_to to set associated_foreign_key like has_and_belongs_to_many. I don''t know how to deal with it. Please help. Thanks. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" g...
2010 Oct 06
2
reflect_on_association method
Hi all, I am having trouble trying to use reflect_on_association method with given the simplified model: class Order < ActiveRecord::Base belongs_to :contractor, :class_name => "BusinessUnit" end I expected the reflect_on_association method to return associated_foreign_key "contractor_id" but it returns "business_unit_id": ruby-1.9.2-p0 > Order.reflect_on_association(:contractor).association_foreign_key => "business_unit_id" do I miss something? -- You received this message because you are subscribed to the Google Groups &quot...
2008 Sep 01
2
HABTM Question
OK, I''m working on a simple site to share music created by users from a forum I belong to. I''m trying to make it so users can follow other users to keep track of what they''re up to (sort of like Twitter if you know how that works). Currently I''m working on the page that displays the users that follow a certain user, I can easily do the reverse of this (see what