Hello Patrick,
> I have three tables:
> groups(id,name)
> forums(id,name)
> permissions(group_id,forum_id,read_forum,post_replies,post_topics)
If you've got Group has_many :forums, :through => :permissions
and Forum has_many :groups, :through => :permissions
then your permissions table must have an id column.
Your migration should look like this :
create_table :permissions do |t|
t.column :group_id, :integer
t.column :forum_id, :integer
t.column :read_forum, :integer # with some :default => 0 maybe
t.column :post_replies, :integer
t.column :post_topics, :integer
end
> # now in script/console I do:
>
> forum=Forum.find_first
> group=Group.find_first
find :first is less deprecated thant find_first
-- Jean-François.
--
À la renverse.
--~--~---------~--~----~------------~-------~--~----~
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-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---