Module: CurationConcern::WithEditors
- Extended by:
- ActiveSupport::Concern
- Included in:
- Work
- Defined in:
- app/models/concerns/curation_concern/with_editors.rb
Instance Method Summary collapse
- #add_editor(user) ⇒ Object
- #add_editor_group(group_name) ⇒ Object
- #add_editor_groups(groups) ⇒ Object
- #add_editors(users) ⇒ Object
- #remove_editor(user) ⇒ Object
- #remove_editor_group(group) ⇒ Object
- #remove_editor_groups(groups) ⇒ Object
- #remove_editors(users) ⇒ Object
Instance Method Details
#add_editor(user) ⇒ Object
24 25 26 |
# File 'app/models/concerns/curation_concern/with_editors.rb', line 24 def add_editor(user) self.edit_users += [user] end |
#add_editor_group(group_name) ⇒ Object
5 6 7 |
# File 'app/models/concerns/curation_concern/with_editors.rb', line 5 def add_editor_group(group_name) self.edit_groups += [group] end |
#add_editor_groups(groups) ⇒ Object
10 11 12 |
# File 'app/models/concerns/curation_concern/with_editors.rb', line 10 def add_editor_groups(groups) groups.each { |g| add_editor_group(g) } end |
#add_editors(users) ⇒ Object
29 30 31 |
# File 'app/models/concerns/curation_concern/with_editors.rb', line 29 def add_editors(users) users.each { |u| add_editor(u) } end |
#remove_editor(user) ⇒ Object
34 35 36 |
# File 'app/models/concerns/curation_concern/with_editors.rb', line 34 def remove_editor(user) self.edit_users -= [user] end |
#remove_editor_group(group) ⇒ Object
14 15 16 |
# File 'app/models/concerns/curation_concern/with_editors.rb', line 14 def remove_editor_group(group) self.edit_groups -= [group] end |
#remove_editor_groups(groups) ⇒ Object
19 20 21 |
# File 'app/models/concerns/curation_concern/with_editors.rb', line 19 def remove_editor_groups(groups) groups.each { |g| remove_editor_group(g) } end |
#remove_editors(users) ⇒ Object
39 40 41 |
# File 'app/models/concerns/curation_concern/with_editors.rb', line 39 def remove_editors(users) users.each { |u| remove_editor(u) } end |