Patch #27510
closed
Introduce active? method to Group via Principal model
Added by Aleksandar Pavic about 7 years ago.
Updated 3 months ago.
Category:
Code cleanup/refactoring
Description
Groups should have "active" method, because they can be assigned issues to, and are treated in many ways as users.
Some plugins like https://github.com/Restream/redmine_reminder use it, and even cause error as described here
https://github.com/Restream/redmine_reminder/issues/5
Even though it could be resolved as a plugin my opinion is that groups.rb model should have active method, simply because they
already have status attribute...
So proposed is to add active? method, as provided in patch file.
Files
Why not in Principal model?
The attached patch moves active?
, registered?
, and locked?
methods from the User model to the Principal model.
With this change, groups will also have these three methods, just like users.
- Subject changed from Groups active method to Add active?, registered?, and locked? methods to the Group model by moving them from the Users model to the Principal model
- Category changed from Groups to Code cleanup/refactoring
- Target version changed from Candidate for next major release to 6.0.0
Setting the target version to 6.0.0.
- Subject changed from Add active?, registered?, and locked? methods to the Group model by moving them from the Users model to the Principal model to Add active?, registered?, and locked? methods to the Group model by moving them from the User model to the Principal model
- File 27510-v2.patch 27510-v2.patch added
- Subject changed from Add active?, registered?, and locked? methods to the Group model by moving them from the User model to the Principal model to Add active? method to the Group model by moving it from the User model to the Principal model
Updated the patch. This version of the patch moves only the active?
method, does not move registered?
and locked?
methods to the Principal model. This is because the Group model does not allow STATUS_LOCKED
and STATUS_REGISTERED
statues.
source:tags/5.1.3/app/models/group.rb#L34
self.valid_statuses = [STATUS_ACTIVE]
- Subject changed from Add active? method to the Group model by moving it from the User model to the Principal model to Introduce active? method to Group via Principal model
- Status changed from New to Closed
- Assignee set to Go MAEDA
Committed the patch in r22976.
Also available in: Atom
PDF