github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

JonMidhir / simple_groups

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 38
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Rails plugin that adds a basic system for creating user maintained groups. — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

fifth commit 
Jon Hope (author)
Wed Dec 10 16:43:49 -0800 2008
commit  13a8e7f89abe8241c167824f45762380b0a3073f
tree    278df9fd68d9797ac81f42c5e70cd0f8030087f0
parent  6a7936dbd85868310e8711b495d5a0ed022e3eed
simple_groups /
name age
history
message
file .DS_Store Loading commit data...
file MIT-LICENSE
file README
file Rakefile
file about.yml
directory generators/
file init.rb
file install.rb
directory lib/
README
Simple Groups
========

This plugin creates a group model and relates it to your User model via a has_many :through relationship. It is designed 
for use with restful_authentication but could be used with any User model.

To install:

script/plugin install git://github.com/JonMidhir/simple_groups.git

To use:

script/generate simple_groups Group

If you wish you can rename the last parameter anything you want, but Group is probably the most appropriate! Add 
--skip-migration to avoid creating the migration files.

Add this near the top of your User model:
include_simple_groups

Remember to run the migrations:
rake db:migrate


Usage
=======

These methods are available to your controllers and views after installation, many are self.explanatory!

user.groups
user.pending_groups
user.is_member_of?(group)
user.is_mod_of?(group)
user.request_membership_of(group)
user.pending_and_accepted_groups
user.membership(group)
user.leave(group)
user.become_member_of(group)

The following can be called on the group model.

group.members
group.mods
group.pending_members
group.accept_member(user)
group.pending_and_accepted_members
group.kick(user)
group.mods_online
group.members_online
group.members_offline
group.has_member?(user)

Note that currently the user requests membership of the group and the group accepts membership of the user. It is up to 
you to protect this functionality and restrict it to mods only. If you want your groups to be open use the 
user.become_member_of(group) method.


Copyright (c) 2008 Jon M Hope, released under the MIT license
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server