aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-07-31 15:32:57 +0100
committerLouise Crow <louise.crow@gmail.com>2013-09-16 12:11:40 +0100
commita23be37bb6b4c4991766e1ed0f9cd0922c8db3a7 (patch)
tree43bd8057a5a0b6fcc45824e8d79079876c26c62c /app/models
parent220e4ac2c76c16b3d16c77753228fe439bafc7c7 (diff)
Remove prominence.
Add a migration to remove the unused column 'prominence' from info_request_events, remove validation of prominence, remove unused InfoRequestEvent.user_can_view? method. Remove references to InfoRequestEvent.prominence.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/info_request_event.rb23
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 => [