diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-04-23 17:27:45 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-04-24 12:31:16 +0200 |
commit | 04020d5e2038e9acd31147c16dc07fb5a2360a24 (patch) | |
tree | cdc8939de4e4c264fa097f935e2e15c9c77d9a5d /app/models/concerns | |
parent | 6f8ff08c65f954707cb426dace802a32a02a04f6 (diff) | |
download | gitlab-ce-04020d5e2038e9acd31147c16dc07fb5a2360a24.tar.gz |
Explain purpose and usage.
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/participable.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/models/concerns/participable.rb b/app/models/concerns/participable.rb index a01b28ea8db..7a5e4876ff2 100644 --- a/app/models/concerns/participable.rb +++ b/app/models/concerns/participable.rb @@ -1,3 +1,27 @@ +# == Participable concern +# +# Contains functionality related to objects that can have participants, such as +# an author, an assignee and people mentioned in its description or comments. +# +# Used by Issue, Note, MergeRequest, Snippet and Commit. +# +# Usage: +# +# class Issue < ActiveRecord::Base +# include Participable +# +# # ... +# +# participant :author, :assignee, :mentioned_users, :notes +# end +# +# issue = Issue.last +# users = issue.participants +# # `users` will contain the issue's author, its assignee, +# # all users returned by its #mentioned_users method, +# # as well as all participants to all of the issue's notes, +# # since Note implements Participable as well. +# module Participable extend ActiveSupport::Concern |