18 Commits

Author SHA1 Message Date
Jan Sandbrink 0b87e7543f Freeze string literals in specs
Rolling out frozen string literals further by freezing all
string literals in core specs.
2025-05-05 09:29:55 +02:00
Kabiru Mwenja b6367992bc Revert "fix[Op#59433]: simplify reminder model to directly linked to notification"
This reverts commit ae3f77da80.

Maintain a persistent record of reminder notifications as notifications are always retrievable by the user, e.g. via
email, viewing "all" notifications.

A reminder notification is only created IF there are no active unread notifications, hence when rescheduling, snoozing or editing a reminder then
ensure all previous notifications are marked as read- as we should not have duplicate notifications for a given reminder.
2024-11-27 12:39:46 +03:00
Kabiru Mwenja 89bd340e93 Ensure notifications are unique to reminders
Add uniqueness index on NOT null

```
-- add_index(:reminders, :notification_id, {:unique=>true, :where=>"notification_id IS NOT NULL", :name=>"index_reminders_on_notification_id_unique"})
   (1.0ms)  CREATE UNIQUE INDEX "index_reminders_on_notification_id_unique" ON "reminders" ("notification_id") WHERE notification_id IS NOT NULL
```

On notification delete, nullify the reminder record- at present reminders are a persistent record (so are notifications, but that could change).
2024-11-25 11:18:08 +03:00
Kabiru Mwenja 67f524a9c5 Add Notification assoc tests 2024-11-21 14:51:26 +03:00
Kabiru Mwenja 6137d1b427 feat[Op#59434]: add notification reason reminder 2024-11-20 14:05:30 +03: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
Christophe Bliard 4c2a9d0aa8 Enable RSpec zero monkey patching mode
The plan for RSpec 4.0 is to disable monkey patching.

See https://github.com/rspec/rspec-core/blob/main/features/configuration/zero_monkey_patching_mode.feature for details.
2023-05-31 19:22:29 +02:00
Christophe Bliard 85b3258a29 Autocorrect with some rubocop cops
RSpec/Rails/InferredSpecType and Style/RedundantConstantBase

rubocop --autocorrect-all --only RSpec/Rails/InferredSpecType,Style/RedundantConstantBase spec modules/*/spec
2023-01-13 14:28:59 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01: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 f08bea3467 Remove FactoryBot.* prefix where applicable 2022-01-25 08:19:06 +01:00
Oliver Günther 3d78f7bc29 Override factory default when trying invalid journal 2021-10-05 22:19:56 +02:00
ulferts 98d74e00de ensure notifications are linked to existing journals
There can be a race condition when a user continues to alter a work package or other resource after a first change has been made resulting in a journal and the background process creating a notification for that journal. If the second journal caused by the users continued interaction removes the first journal after the job for creating a notification has already started, all checks within ruby are blind. Therefore a foreign key constraint is needed.
2021-09-22 15:43:44 +02:00