aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/incoming_message.rb8
-rw-r--r--app/views/admin_incoming_message/edit.html.erb2
2 files changed, 3 insertions, 7 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 5ad645200..96ecc7d53 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -38,6 +38,7 @@ require 'zip/zip'
require 'iconv' unless RUBY_VERSION >= '1.9'
class IncomingMessage < ActiveRecord::Base
+ extend MessageProminence
belongs_to :info_request
validates_presence_of :info_request
@@ -49,8 +50,7 @@ class IncomingMessage < ActiveRecord::Base
belongs_to :raw_email
- PROMINENCE_STATES = ['normal', 'hidden','requester_only']
- validates_inclusion_of :prominence, :in => PROMINENCE_STATES
+ has_prominence(prominence_states = ['normal', 'hidden','requester_only'])
# See binary_mask_stuff function below. It just test for inclusion
# in this hash, not the value of the right hand side.
@@ -69,10 +69,6 @@ class IncomingMessage < ActiveRecord::Base
self.info_request_events.detect{ |e| e.event_type == 'response' }
end
- def user_can_view?(user)
- Ability.can_view_with_prominence?(self.prominence, self.info_request, user)
- end
-
def all_can_view?
self.prominence == 'normal'
end
diff --git a/app/views/admin_incoming_message/edit.html.erb b/app/views/admin_incoming_message/edit.html.erb
index 9cbaf013c..f37907c32 100644
--- a/app/views/admin_incoming_message/edit.html.erb
+++ b/app/views/admin_incoming_message/edit.html.erb
@@ -6,7 +6,7 @@
<div class="control-group">
<label class="control-label" for="incoming_message_prominence"> Prominence</label>
<div class="controls">
- <%= select('incoming_message', "prominence", IncomingMessage::PROMINENCE_STATES) %>
+ <%= select('incoming_message', "prominence", IncomingMessage.prominence_states) %>
</div>
</div>