Due to STI nature it is required. Otherwise undesired behavior is possible
in dev and test environments(where usually lazy loading is enabled).
The udesired behavior can be like:
Fetching not loaded yet STI model through its parent model
(e.g. `User.find(service_account_id)` raises `ActiveRecord::NotFound`, because
`ServiceAccount` has not been referenced yet.
`SubclassRegistry` has been removed, because:
1. `.register_subclasses` and `.registered_subclasses` produce unexpected results.
```ruby
# e.g.: Principal -> User -> ServiceAccount
Principal.register_subclass(User)
# Then
Principal.registered_subclasses == [User] # true
User.registered_subclasses == [User] # true
ServiceAccount.registered_subclasses == [User] # true
# Having User as a subclass of User and ServiceAccount seems to be weird.
```
2. There seems to be no big win in have the additional list of subclasses that have to be manually filled.
3. Used in commit apprach seems to be simpler.
It is just calling STI classes explicitly in to_prepare block of configuration.
- **it's** is a contraction of _it is_ or _it has_. It requires an
apostrophe.
- **its** is the posssive form of _it_, denoting ownership. It should
not use an apostrophe.
Role name being limited to 30 characters does not work anymore with some
translations of default seeded roles. Raising the limit to 256
characters like a lot of other models.
The ones I could find while trying to cope with config.active_record.belongs_to_required_by_default = true to make tests pass, before finally giving up when I realized that Notification.journal cannot be nil, and be set in tests.
Updates the copyright to 2021 for all files that have a copyright. Files in our source code without the copyright header still do not receive one automatically. Additionally, backlisted files are also excluded.
Previously the copyright of chiliproject which references redmine stated a copyright of redmine up to and including 2017 which is not true for the code we have in here. Because of that I changed that to 2013
Uses FactoryBot to keep and maintain specific records in a special transaction that does not get removed after each spec.
They automatically are created whenever first hitting them.
This makes an excellent time saver for items that are commonly used, such as an admin user account
* read operations for time_entries via api v3
Introduces the endpoints:
* GET /api/v3/time_entries
* GET /api/v3/time_entries/:id
* GET /api/v3/time_entries/activities/:id
The index action for time entries can be queried by the following
filters:
* project_id
* user_id
* work_package_id
The implementation is exposing the database structure mostly one to one
with the exception of some renaming and the hiding of the activities'
complexity, where only the activity used systemwide is referenced
regardless of whether a project specific override exists or not.
* allow custom values for time entries
[ci skip]
- foo ? true : false was replaced where foo already was bool
- foo ? true : false was kept, when the ternary did a bool conversion
- foo ? false : true was replaced by either negation or replacing == with !=
Note: I intentionally left one occurence that is fixed in another running PR and would cause a conflict