aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r--app/models/info_request.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index 0a073dc79..aaed99d81 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -40,7 +40,7 @@ class InfoRequest < ActiveRecord::Base
validate :must_be_internal_or_external
belongs_to :public_body, :counter_cache => true
- validates_presence_of :public_body_id
+ validates_presence_of :public_body_id, :unless => Proc.new { |info_request| info_request.is_batch_request_template? }
has_many :outgoing_messages, :order => 'created_at'
has_many :incoming_messages, :order => 'created_at'
@@ -50,6 +50,7 @@ class InfoRequest < ActiveRecord::Base
has_many :comments, :order => 'created_at'
has_many :censor_rules, :order => 'created_at desc'
has_many :mail_server_logs, :order => 'mail_server_log_done_id'
+ attr_accessor :is_batch_request_template
has_tag_string
@@ -122,6 +123,10 @@ class InfoRequest < ActiveRecord::Base
!InfoRequest.enumerate_states.include? described_state
end
+ def is_batch_request_template?
+ is_batch_request_template == true
+ end
+
# The request must either be internal, in which case it has
# a foreign key reference to a User object and no external_url or external_user_name,
# or else be external in which case it has no user_id but does have an external_url,