Sha256: 5144d59e4561a874471648ba251d688e937ed2a984eb5ec1247c5c16012148f5

Contents?: true

Size: 805 Bytes

Versions: 5

Compression:

Stored size: 805 Bytes

Contents

# Member
It is a model of class which was registered in Monarchy config and is acting as `acts_as_member`.

## Methods:

### #resource
Returns a resource of member, example:
``` ruby
User was granted to Project so the resource of his Member will be Project
```

### #resource=
You can overwrite a `#resource` for `member` by using:
```ruby
member.resource = new_resource_model
```

## Scopes:

### .accessible_for
You can select all members accessible for specific user by using a scope: `accessible_for`, eg:
``` ruby
Monarchy::member_class.accessible_for(current_user)   # returns [member1, member2, member5]
```
## Public Relations:

### #roles
Returns all roles explicitly assigned to the member.

### #user
Returns a user model of the member.

### #hierarchy
Returns a hierarchy model of the member.

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
monarchy-2.0.8 docs/acts_as_member.md
monarchy-2.0.7 docs/acts_as_member.md
monarchy-2.0.6 docs/acts_as_member.md
monarchy-2.0.5 docs/acts_as_member.md
monarchy-2.0.4 docs/acts_as_member.md