diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-10-24 14:35:25 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-12-04 09:32:42 +0000 |
commit | 9a5c01d781129aeb1ab2b18771ac131ecdfb56c1 (patch) | |
tree | 78a4c2f3d0bf2037935d6f38b4866959ef13e7ec /app/models/info_request.rb | |
parent | 857128b465cf345756bbeabbccdc673921090210 (diff) |
Add InfoRequestBatch model.
Re-annotate models. Index InfoRequestBatches by user - we'll display the
batches for a user when they view their own requests.
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r-- | app/models/info_request.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index a79ede809..3c3afe0ea 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1,5 +1,6 @@ # encoding: utf-8 # == Schema Information +# Schema version: 20131024114346 # # Table name: info_requests # @@ -21,6 +22,7 @@ # external_url :string(255) # attention_requested :boolean default(FALSE) # comments_allowed :boolean default(TRUE), not null +# info_request_batch_id :integer # require 'digest/sha1' @@ -40,6 +42,7 @@ class InfoRequest < ActiveRecord::Base validate :must_be_internal_or_external belongs_to :public_body, :counter_cache => true + belongs_to :info_request_batch validates_presence_of :public_body_id, :unless => Proc.new { |info_request| info_request.is_batch_request_template? } has_many :outgoing_messages, :order => 'created_at' |