From 843662821ddbf2d06aa2da72ce32717cebecb7c6 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 13 Jan 2016 11:46:32 -0500 Subject: Move `BroadcastMessage#status` to a helper since it's presentational --- app/helpers/broadcast_messages_helper.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/helpers') 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 -- cgit v1.2.1