diff options
Diffstat (limited to 'app/models/info_request_event.rb')
-rw-r--r-- | app/models/info_request_event.rb | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index 0967e3940..2350aea01 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -63,35 +63,12 @@ class InfoRequestEvent < ActiveRecord::Base # user described state (also update in info_request) validate :must_be_valid_state - # whether event is publicly visible - validates_inclusion_of :prominence, :in => [ - 'normal', - 'hidden', - 'requester_only' - ] - def must_be_valid_state if !described_state.nil? and !InfoRequest.enumerate_states.include?(described_state) errors.add(described_state, "is not a valid state") end end - def user_can_view?(user) - unless info_request.user_can_view?(user) - raise "internal error, called user_can_view? on event when there is not permission to view entire request" - end - - case prominence - when 'hidden' - User.view_hidden_requests?(user) - when 'requester_only' - info_request.is_owning_user?(user) - else - true - end - end - - # Full text search indexing acts_as_xapian :texts => [ :search_text_main, :title ], :values => [ |