diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/info_request.rb | 28 | ||||
-rw-r--r-- | app/models/rejection_reason.rb | 50 |
2 files changed, 9 insertions, 69 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index eb02587a8..72500d9e0 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -4,7 +4,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request.rb,v 1.13 2007-11-14 01:01:39 francis Exp $ +# $Id: info_request.rb,v 1.14 2007-11-23 10:57:24 francis Exp $ require 'digest/sha1' @@ -61,13 +61,14 @@ class InfoRequest < ActiveRecord::Base def calculate_status # Extract aggregate information for any incoming messages all together contains_information = false - rejection_reasons = [] + missing_classification = false self.incoming_messages.each do |msg| if msg.user_classified if msg.contains_information contains_information = true end - rejection_reasons += msg.rejection_reasons + else + missing_classification = true end end @@ -90,26 +91,15 @@ class InfoRequest < ActiveRecord::Base return "awaiting" end end - if contains_information and rejection_reasons.size > 0 - return "information_and_rejection" + if missing_classification + return "unknown" end - if contains_information and rejection_reasons.size == 0 + if contains_information return "information" + else + return "none" end - if rejection_reasons.size > 0 - return "rejection" - end - return "unknown" end - # - Awaiting response (in 20 working day limit) - # - Overdue a response (over 20 working day limit) - # - # - Has a response but not sure what to think of it - # - Received a positive response - # - Received a partly positive response w/ rejection reasons - # - Received an entirely negative response w/ rejection reasons - # - # - Have sent a follow up end diff --git a/app/models/rejection_reason.rb b/app/models/rejection_reason.rb deleted file mode 100644 index 347aeff1f..000000000 --- a/app/models/rejection_reason.rb +++ /dev/null @@ -1,50 +0,0 @@ -# app/models/rejection_reasons.rb -# Give one reason under the Freedom of Information Act 2000 as to why -# a particular incoming message was rejected. An incoming message can -# have multiple such reasons. -# -# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. -# Email: francis@mysociety.org; WWW: http://www.mysociety.org/ -# -# $Id: rejection_reason.rb,v 1.2 2007-11-22 15:22:36 francis Exp $ - -class RejectionReason < ActiveRecord::Base - belongs_to :incoming_message - validates_presence_of :incoming_message_id - - @@all_reasons = [ - { "section21" => "Information accessible to applicant by other means" }, - { "section22" => "Information intended for future publication" }, - { "section23" => "Information supplied by, or relating to, bodies dealing with security matters" }, - { "section24" => "National security" }, - { "section25" => "Certificates under ss. 23 and 24: supplementary provisions" }, - { "section26" => "Defence" }, - { "section27" => "International relations" }, - { "section28" => "Relations within the United Kingdom" }, - { "section29" => "The economy" }, - { "section30" => "Investigations and proceedings conducted by public authorities" }, - { "section31" => "Law enforcement" }, - { "section32" => "Court records, etc" }, - { "section33" => "Audit functions" }, - { "section34" => "Parliamentary privilege" }, - { "section35" => "Formulation of government policy, etc" }, - { "section36" => "Prejudice to effective conduct of public affairs" }, - { "section37" => "Communications with Her Majesty, etc. and honours" }, - { "section38" => "Health and safety" }, - { "section39" => "Environmental information" }, - { "section40" => "Personal information" }, - { "section41" => "Information provided in confidence" }, - { "section42" => "Legal professional privilege" }, - { "section43" => "Commercial interests" }, - { "section44" => "Prohibitions on disclosure" } - ] - @@all_reasons_array = @@all_reasons.map{ |h| h.keys }.flatten - @@all_reasons_hash = {} - @@all_reasons.each { |h| @@all_reasons_hash.merge!(h) } - - cattr_accessor :all_reasons_array - cattr_accessor :all_reasons_hash - -# validates_inclusion_of :reason, :in => RejectionReason.all_reasons_array -end - |