diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-27 19:04:29 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-27 19:04:29 +0200 |
commit | d55ade16861d0700e302f50945560e8570eddcd7 (patch) | |
tree | c060eeebda2144cb47e4d56eb271724fddd9856a /app/models/notification.rb | |
parent | 5f14a6bcf8ca5ec4325bae401069c3a03a617bd0 (diff) | |
download | gitlab-ce-d55ade16861d0700e302f50945560e8570eddcd7.tar.gz |
notification scaffold
Diffstat (limited to 'app/models/notification.rb')
-rw-r--r-- | app/models/notification.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/app/models/notification.rb b/app/models/notification.rb new file mode 100644 index 00000000000..bfd1e2cff56 --- /dev/null +++ b/app/models/notification.rb @@ -0,0 +1,30 @@ +class Notification + # + # Notification levels + # + N_DISABLED = 0 + N_PARTICIPATING = 1 + N_WATCH = 2 + + attr_accessor :user + + def self.notification_levels + [N_DISABLED, N_PARTICIPATING, N_WATCH] + end + + def initialize(user) + @user = user + end + + def disabled? + user.notification_level == N_DISABLED + end + + def participating? + user.notification_level == N_PARTICIPATING + end + + def watch? + user.notification_level == N_WATCH + end +end |