Commit graph

14 commits

Author SHA1 Message Date
Felipe Artur
ef12973723 Allow to toggle notifications for issues due soon 2018-07-12 12:03:29 -03:00
Lin Jen-Shin
4ee08b77bc Updates from rubocop -a 2018-07-09 21:13:08 +08:00
blackst0ne
0319da686d [Rails5] Fix spec/models/notification_setting_spec.rb
In Rails 5 assigning a value which is not explicitly `true` or `false` to a boolean column transforms it to `true`.
In Rails 4 it transforms the value to `false` with the deprecation warning:

```
DEPRECATION WARNING: You attempted to assign a value which is not explicitly `true` or `false` ("nil") to a boolean column. Currently this value casts to `false`. This will change to match Ruby's semantics, and will cast to `true` in Rails 5. If you would like to maintain the current behavior, you should explicitly handle the values you would like cast to `false`.
```

This commit fixes the spec that expects to receive Rails 4 behavior.
2018-05-01 18:30:37 +11:00
Sean McGivern
57a5544f88 Remove events column from notification settings
This was migrated to separate columns in 9.4, and now just needs to be removed
for real.
2017-07-31 11:18:55 +01:00
Keifer Furzland
7e113b6824 Remove superfluous type defs in specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:52 +02:00
Dmitriy Zaporozhets
3a0b9e06e1
Adjust tests to work with latest shoulda gem
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-07-24 19:26:15 +03:00
Dmitriy Zaporozhets
cc577b8970
Update tests for new version of shoulda-matchers
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-07-24 15:33:14 +03:00
Sean McGivern
e94c1028c1 Deserialise existing custom notification settings
Create a post-deployment migration to update all existing notification settings
with at least one custom level enabled to the new format. Also handle the same
conversion when updating settings, to catch any stragglers.
2017-06-15 15:15:13 +01:00
Sean McGivern
ea25e0918b Exclude projects pending delete from notifications
If the Sidekiq job fails for some reason, a project can be 'stuck'
pending deletion. The project can't be viewed, so it shouldn't be
available through the notification settings association as this will
throw an exception when we try to show the link.
2016-07-07 20:49:17 +01:00
Felipe Artur
89a2c8730b Implement custom notification level options 2016-06-15 11:47:50 -03:00
Felipe Artur
8f6d43e0fe Remove notification level from user model 2016-06-10 10:58:13 -03:00
Dmitriy Zaporozhets
630c86a7a3 Add spec for user_id uniq in NotificationSetting model
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-30 10:44:20 +02:00
Dmitriy Zaporozhets
4ca73f56cb Small refactoring and cleanup of notification logic
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-30 10:44:20 +02:00
Dmitriy Zaporozhets
31b0e53015 Introduce NotificationSetting model
It will hold notification setting per group or per project. It will
allow get rid of notification level stored in Member model

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-30 10:44:20 +02:00