1))))) class Group < ActiveRecord::Base

has_many :group_users
  has_many :users, :through => :group_users
end

2)))))))))class User < ActiveRecord::Base
has_many :group_users
  has_many :groups, :through => :group_users
end

3))))))class CreateGroupUsers < ActiveRecord::Migration   # JOINING
TABLE
  def self.up
    create_table :group_users do |t|
    t.column    :group_id,    :string
    t.column    :user_id,    :string
  t.column  :group_admin, :boolean
      t.timestamps
    end
  end

Can anybody please help me how to set the value of group_admin in
GroupUsers ?

I want to do like this :

@group.group_users.group_admin =1 (X- NOT WORKING THOUGH)
-- 
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to