Project

General

Profile

Actions

Patch #27510

closed

Introduce active? method to Group via Principal model

Added by Aleksandar Pavic about 7 years ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

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

group.rb.diff (276 Bytes) group.rb.diff Aleksandar Pavic, 2017-11-10 14:35
27510.patch (1.34 KB) 27510.patch Go MAEDA, 2024-08-18 08:05
27510-v2.patch (1.06 KB) 27510-v2.patch Go MAEDA, 2024-08-20 05:25
Actions #1

Updated by Toshi MARUYAMA almost 7 years ago

Why not in Principal model?

Actions #2

Updated by Go MAEDA 3 months ago

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.

Actions #3

Updated by Go MAEDA 3 months ago

  • 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.

Actions #4

Updated by Go MAEDA 3 months ago

  • 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
Actions #5

Updated by Go MAEDA 3 months ago

  • 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]

Actions #6

Updated by Go MAEDA 3 months ago

  • 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.

Actions

Also available in: Atom PDF