Craig Demyanovich wrote: > Using the :foreign_key option isn't incorrect. It's there if you need to > circumvent the Rails defaults for any reason. If you didn't want to use > the > :foreign_key option, you could use a migration to rename the color_id > and > color2_id columns in your shirts table to primary_color_id and > secondary_color_id, respectively. Then, you could just declare your > associations like this: > > class Shirt < ActiveRecord::Base > belongs_to :primary_color, :class_name => "ApprovedColor" > belongs_to :secondary_color, :class_name => "ApprovedColor" > end > > Regards, > Craig
Good lord you're good. :-) I really need to stop hacking and start learning more (even though I have learned a lot). Many thanks again for your help. I ended up going the foreign_key-less way. -Thanks -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---