No description, website, or topics provided.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
tasks
test
MIT-LICENSE
README
Rakefile
init.rb
install.rb
uninstall.rb

README

ActsAsGroupable
===============

Fairly simple way to get groups for your rails app

Migration
=======

class CreateGroups < ActiveRecord::Migration
  def self.up
    create_table :groups, :force => true do |t|
      t.string :name, :description
      t.timestamps
    end
    
    create_table :groups_users, :force => true do |t|
      t.integer :group_id, :user_id
      t.string  :role, :length => 25
      t.timestamps
    end
  end

  def self.down
    drop_table :group_users
    drop_table :groups
  end
end

Example:
======

class User < ActiveRecord::Base
  acts_as_groupable
end

# To Join a group use:
>> User.first.join_group(Group.first)

# To leave a group use:
>> User.first.leave_group(Group.first)


Ok, so this only took me less than 30 minutes to create. This works and don't be too much of a wise-ass. Go ahead and fork it if you want a better version. K?