diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-01-13 11:46:32 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-01-13 11:49:59 -0500 |
commit | 843662821ddbf2d06aa2da72ce32717cebecb7c6 (patch) | |
tree | 6885e93e3e106f86102d8ac2641fb6e79116889a /app/helpers | |
parent | c13b5acb16c7813d6913e26cc7ae67f691f914d6 (diff) | |
download | gitlab-ce-843662821ddbf2d06aa2da72ce32717cebecb7c6.tar.gz |
Move `BroadcastMessage#status` to a helper since it's presentational
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/broadcast_messages_helper.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/helpers/broadcast_messages_helper.rb b/app/helpers/broadcast_messages_helper.rb index 44bb09b74f4..1ed8c710f77 100644 --- a/app/helpers/broadcast_messages_helper.rb +++ b/app/helpers/broadcast_messages_helper.rb @@ -21,4 +21,14 @@ module BroadcastMessagesHelper style end + + def broadcast_message_status(broadcast_message) + if broadcast_message.active? + 'Active' + elsif broadcast_message.ended? + 'Expired' + else + 'Pending' + end + end end |