README.md in camaraderie-0.1.3 vs README.md in camaraderie-0.2
- old
+ new
@@ -1,8 +1,9 @@
# Camaraderie
[](https://rubygems.org/gems/camaraderie)
+[](https://travis-ci.org/mirego/camaraderie)
Camaraderie takes away the pain of managing membership stuff between users and organizations.
## Installation
@@ -22,11 +23,18 @@
First, you have to configure which type of memberships you want. Usually, you’d do this in `./config/initializers/camaraderie.rb`:
```ruby
Camaraderie.configure do |config|
+ # The different types of memberships (defaults to `['admin']`)
config.membership_types = %w(admin moderator member)
+
+ # The class name of the organization model (defaults to `'Organization'`)
+ config.organization_class = 'Company'
+
+ # The class name of the user model (defaults to `'User'`)
+ config.user_class = 'Employee'
end
```
Then, you can include the two provided modules into your `User`, `Organization` and `Membership` models:
@@ -57,9 +65,13 @@
organization.members.create(user: user)
# Check whether the user is an admin
user.admin_of?(organization)
# => true
+
+# List all the admins for the organization
+organization.admin_users
+# => #<ActiveRecord::Relation [<User id=1>]>
```
## License
`Camaraderie` is © 2013 [Mirego](http://www.mirego.com) and may be freely distributed under the [New BSD license](http://opensource.org/licenses/BSD-3-Clause). See the [`LICENSE.md`](https://github.com/mirego/camaraderie/blob/master/LICENSE.md) file.