This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Jon Hope (author)
Wed Dec 10 16:43:49 -0800 2008
| name | age | message | |
|---|---|---|---|
| |
.DS_Store | Mon Dec 08 08:26:06 -0800 2008 | |
| |
MIT-LICENSE | Mon Dec 08 07:26:19 -0800 2008 | |
| |
README | Wed Dec 10 16:43:49 -0800 2008 | |
| |
Rakefile | Mon Dec 08 07:26:19 -0800 2008 | |
| |
about.yml | Wed Dec 10 16:43:49 -0800 2008 | |
| |
generators/ | Mon Dec 08 07:26:19 -0800 2008 | |
| |
init.rb | Mon Dec 08 07:26:19 -0800 2008 | |
| |
install.rb | Mon Dec 08 07:26:19 -0800 2008 | |
| |
lib/ | Mon Dec 08 10:22:39 -0800 2008 |
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







