100 Commits

Author SHA1 Message Date
Alexander Brandon Coles d17da65477 Freeze string literals in app/models
rubocop -A --only Style/FrozenStringLiteralComment,Layout/EmptyLineAfterMagicComment,Style/RedundantFreeze app/models
2025-07-22 18:26:13 +01:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
ulferts 3b2121f733 Revert "Merge remote-tracking branch 'origin/release/13.4' into dev"
This reverts commit 40b2bbeb09, reversing
changes made to b4c6cb17cc.
2024-03-21 11:31:17 +01:00
Ivan Kuchin 7787e457a3 Revert "Merge branch 'dev' into release/13.4"
This reverts commit a901541269, reversing
changes made to e573ca00b7.
2024-03-20 20:19:08 +01:00
Ivan Kuchin 9e4934cd0a change quotes using rubocop --only Style/StringLiterals,Style/QuotedSymbols -a 2024-03-20 18:05:22 +01:00
Christophe Bliard c795874f7f Update copyright year for 2024
command used: `rg -l 'Copyright \(C\) 2012-202\d the OpenProject' | xargs -n 100 sed -i -r 's/Copyright \(C\) 2012-202. the OpenProject/Copyright (C) 2012-2024 the OpenProject/'`
2024-01-02 16:23:54 +01:00
Klaus Zanders 61f273b10e Replace allowed_to? calls in models 2023-10-31 10:35:36 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Christophe Bliard 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
Christophe Bliard a33524ef6d remove ruby magic comment for utf-8
ruby interprets source encoding as utf-8 since 2.0.0, making magic comment redundant and useless
2022-03-10 19:36:58 +01:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Oliver Günther ccfa29c728 Move license and copyright docs to root, fix names and references 2021-09-02 21:50:46 +02:00
ulferts 63ad2e8dd1 Generate IAN near real time (#9570)
* destroy notifications upon journal destruction

* breakup spec by journable

* have a dedicated job for scheduling journal completed events

* generate notifications in delayed job

* route wiki journal events through notifications

* combine mail sending for notifications into single job

* robustness if a journal is deleted

* linting

* differentiate BaseJournal and AssociatedJournal

BaseJournal holds the data of a journal that reflects the columns in the journaled model while AssociatedJournal reflects the columns of a model associated to the journaled model via a has_many/one association

* route news journal events through notifications

This does not yet include notifications for comments on news

* include news comment in notification workflow

* have the whole workflow in a single state machine job

* include forum message in notification workflow

* include document in notification workflow

* less dependencies from acts as watchable

* fix, test and document workflow job
2021-08-23 15:25:47 +02:00
ulferts 1bdd2ab9ae safe automatic fixes by rubocop (#8994) 2021-02-11 16:02:18 +01:00
ulferts 6140f4c7e9 update copyright to 2021 (#8925)
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
2021-01-13 17:47:45 +01:00
ulferts 6cce947cbd Chore/rename timestamps (#8765)
* rename timestamps on time entry

* add updated_at filter/order for time entries

* rename on cost entries as well

This will make handling in the cost query easier

* adapt specs

* linting

* adapt project activity

* update references to updated_on

* remove outdated docs/code

* global memberships are just memberships

* rewire global membership creation/update/deletion

* delete no longer required code and patches

* move code to core

* move specs to core

* completely remove global roles in the form of a plugin

* adapt specs

* remove unused methods

* migrate existing data

* adapt membership representer to changed timestamps

* global memberships available via API

* implements created/update_at filters on memberships

* update member on roles being added/removed

* specify default value for created_at

* fix project permission check and validation on members

* adapt membership schema

* adapt usage of sort by on members widget

* support created/updated_on for api sort and filter

* remove outdated model file

* rename timestamps

* allow specifying timestamp column for aaj

* reload column information

* further rename of created_on

* include updated_at into journal creation

* adapt document updated_at calculation

* remove references to JournalVersion
2020-12-03 12:00:19 +01:00
Oliver Günther 53f2d694ff Use AnyFixtures to generate fixtures from factories (#7230)
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
2020-04-09 11:54:26 +02:00
ulferts 70a29885d5 fix topic attachment upload 2020-03-02 15:49:32 +01:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
Oliver Günther 3aa3dea512 Allow deliver_later using a custom ApplicationJob
We're getting more and more reports on synchronous Timeouts and SMTP
errors causing internal errors for users when trying to send mail in the
request of the browser.

With rails 5.2, we can assign a custom job that handles the
`deliver_later` delayed sending. We can hook this into the
ApplicationJob with delayed_job.

Since rails now also has GlobalID serialization of ActiveRecord, we
don't even need to do the serialization ourselves!
2019-10-25 09:09:45 +02:00
Oliver Günther c5994d3b9b Rename Boards to Forums 2019-03-13 16:24:15 +01:00
Jens Ulferts 0d22112e0e replace rails based attachment forms and lists completely 2018-08-02 07:42:08 +02:00
Jens Ulferts e58a96515c allow setting attachments through wp post/patch 2018-06-04 09:11:26 +02:00
Jens Ulferts 0b7e192a5d adapt to changes to AR::Dirty 2018-03-05 15:43:37 +01:00
Jens Ulferts 486046681d replace deprecated references to attribute_was/changed 2018-03-05 15:43:35 +01:00
Oliver Günther 6ef4211e77 Bump copyright to 2018 (#6171)
[ci skip]
2018-02-12 08:51:12 +01:00
Oliver Günther 7cf11bb689 Update copyright notice 2017-01-10 15:11:43 +01:00
Jens Ulferts ba37136379 enforce project association on acts_as_watchable 2016-11-22 09:43:36 +01:00
Jens Ulferts 181514742f replace observers by moving functionality inside the observed object
The observers should have been removed a long time ago and with rails 5 there is
https://github.com/rails/rails-observers/issues/52
to consider as well.
2016-09-08 12:40:25 +02:00
Jens Ulferts 6f6598bd84 delete_all and reload rails 5 way 2016-09-08 08:51:28 +02:00
Jens Ulferts 3246747ae0 adapt to newly introduced query 2016-08-25 10:27:33 +02:00
Mohamed Wael Khobalatte d2349cf819 Delete Redmine's safe_attributes implementation
It was an early implementation of strong_parameters, more or less.
Going forward, we should strive to make the whitelisting of attributes
a controller responsibility only.
2015-10-23 14:33:55 +02:00
Mohamed Wael Khobalatte 972b04d86e Refactor to allow for strong params
We no longer need attr_accessible.
2015-10-23 14:33:55 +02:00
Alex Coles 29d9814347 Prefer Project.allowed_to to .allowed_to_condition
Use `ActiveRecord::Relation#merge` to merge scopes.

Signed-off-by: Alex Coles <alex@alexbcoles.com>
2015-07-11 12:24:22 +02:00
Alex Coles c02804b0eb Teach acts_as_searchable a references option
* Update usages in models.

Signed-off-by: Alex Coles <alex@alexbcoles.com>
2015-07-02 20:31:27 +02:00
Alex Coles 787a35c9db Add explicit join references in models
Signed-off-by: Alex Coles <alex@alexbcoles.com>
2015-07-01 20:41:08 +02:00
Alex Coles b2790b8db1 Migrate deprecated .update_all with conditions
Signed-off-by: Alex Coles <alex@alexbcoles.com>
2015-06-30 22:01:03 +02:00
Alex Coles 5557f58e80 Migrate model scopes to use lambda/block
Signed-off-by: Alex Coles <alex@alexbcoles.com>
2015-06-30 12:12:55 +02:00
Alex Coles e0191e759c Update year in copyright header to 2015
[ci skip]
2015-01-01 00:02:57 +00:00
Alex Coles 6fe9535b1f Fix syntax (w/Rubocop) in (Rails) models
Signed-off-by: Alex Coles <alex@alexbcoles.com>
2014-11-03 22:15:11 +01:00
Alex Coles 721101ed25 Use 1.9+ Hash syntax in (Rails) models
Signed-off-by: Alex Coles <alex@alexbcoles.com>
2014-11-03 22:15:11 +01:00
slawa a070cee3d7 Fix sticky date set 2014-03-19 08:29:13 +01:00
slawa c8a15571f2 Reset sticky date when sticky option is reset 2014-03-19 08:25:00 +01:00
Johannes Wollert 8b096975fe updates copyright headers
updates more copyright

more copyright headers
2014-02-27 16:39:51 +01:00
Hagen Schink 955c279e90 Makes models acting as events again 2013-12-02 18:34:24 +01:00
Hagen Schink efffb371e4 Moves message activity provider settings 2013-12-02 18:34:22 +01:00
Till Breuer b57b9a9348 Make message#board_id accessible to allow for moving topics (fixes #2534) 2013-11-14 15:44:57 +01:00
Hagen Schink ec1c287a55 Extracts attachment change handler to module 2013-10-24 11:57:31 +02:00
Hagen Schink c3783d3279 Fixes message attachment add/remove 2013-10-24 11:57:30 +02:00
Hagen Schink fa45f187f6 Extracts attachment change handler to module 2013-10-24 11:48:23 +02:00