aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/info_request.rb3
-rw-r--r--app/models/info_request_batch.rb20
-rw-r--r--app/models/outgoing_message.rb1
-rw-r--r--app/models/public_body.rb1
-rw-r--r--app/models/user.rb2
5 files changed, 27 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'
diff --git a/app/models/info_request_batch.rb b/app/models/info_request_batch.rb
new file mode 100644
index 000000000..af6956095
--- /dev/null
+++ b/app/models/info_request_batch.rb
@@ -0,0 +1,20 @@
+# == Schema Information
+# Schema version: 20131024114346
+#
+# Table name: info_request_batches
+#
+# id :integer not null, primary key
+# title :text not null
+# user_id :integer not null
+# created_at :datetime
+# updated_at :datetime
+#
+
+class InfoRequestBatch < ActiveRecord::Base
+ has_many :info_requests
+ belongs_to :user
+
+ validates_presence_of :user
+ validates_presence_of :title
+
+end
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb
index 8d8322b17..7132ee223 100644
--- a/app/models/outgoing_message.rb
+++ b/app/models/outgoing_message.rb
@@ -1,4 +1,5 @@
# == Schema Information
+# Schema version: 20131024114346
#
# Table name: outgoing_messages
#
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index 8e474c797..2939a7f29 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
# == Schema Information
+# Schema version: 20131024114346
#
# Table name: public_bodies
#
diff --git a/app/models/user.rb b/app/models/user.rb
index 2052b942b..730550301 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,4 +1,5 @@
# == Schema Information
+# Schema version: 20131024114346
#
# Table name: users
#
@@ -20,6 +21,7 @@
# email_bounce_message :text default(""), not null
# no_limit :boolean default(FALSE), not null
# receive_email_alerts :boolean default(TRUE), not null
+# can_make_batch_requests :boolean default(FALSE), not null
#
require 'digest/sha1'