I´m looking for a way to work with compose primary keys. I alredy know that plugin http://compositekeys.rubyforge.org/ but it doesn´t have examples. Please help =] -- Horus Augustus C. C. Lima Sagarana Tech Mobile +55(85)8842.4402 Desk +55(85)3304.6530 augustus-b3GZhX+fmr6XmMXjJBpWqg@public.gmane.org http://www.sagaranatech.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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---
Augustus Costa wrote:> I´m looking for a way to work with compose primary keys. > I alredy know that plugin http://compositekeys.rubyforge.org/ > but it doesn´t have examples.What do you mean it doesn''t have examples? What is this: class Membership < ActiveRecord::Base # set_primary_keys *keys - turns on composite key functionality set_primary_keys :user_id, :group_id belongs_to :user belongs_to :group has_many :statuses, :class_name => ''MembershipStatus'', :foreign_key => [:user_id, :group_id] end -- Posted via http://www.ruby-forum.com/.
there''s a Google group "Composite Keys for ActiveRecord" that you might look at for tips On Jul 2, 7:44 am, Augustus Costa <augustusco...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I´m looking for a way to work with compose primary keys. > I alredy know that pluginhttp://compositekeys.rubyforge.org/ > but it doesn´t have examples. > > Please help =] > > --HorusAugustus C. C. Lima > > Sagarana Tech > Mobile +55(85)8842.4402 > Desk +55(85)3304.6530 > augus...-b3GZhX+fmr6XmMXjJBpWqhHnuRYL88vP@public.gmane.org://www.sagaranatech.com