aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/public_body.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/public_body.rb')
-rw-r--r--app/models/public_body.rb39
1 files changed, 22 insertions, 17 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index 485a794b0..9e77eb181 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -3,23 +3,26 @@
#
# Table name: public_bodies
#
-# id :integer not null, primary key
-# name :text not null
-# short_name :text not null
-# request_email :text not null
-# version :integer not null
-# last_edit_editor :string(255) not null
-# last_edit_comment :text not null
-# created_at :datetime not null
-# updated_at :datetime not null
-# url_name :text not null
-# home_page :text default(""), not null
-# notes :text default(""), not null
-# first_letter :string(255) not null
-# publication_scheme :text default(""), not null
-# api_key :string(255) not null
-# info_requests_count :integer default(0), not null
-# disclosure_log :text default(""), not null
+# id :integer not null, primary key
+# name :text not null
+# short_name :text not null
+# request_email :text not null
+# version :integer not null
+# last_edit_editor :string(255) not null
+# last_edit_comment :text not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# url_name :text not null
+# home_page :text default(""), not null
+# notes :text default(""), not null
+# first_letter :string(255) not null
+# publication_scheme :text default(""), not null
+# api_key :string(255) not null
+# info_requests_count :integer default(0), not null
+# disclosure_log :text default(""), not null
+# info_requests_successful_count :integer
+# info_requests_not_held_count :integer
+# info_requests_overdue_count :integer
#
require 'csv'
@@ -407,6 +410,8 @@ class PublicBody < ActiveRecord::Base
fields = {}
field_names.each{|name, i| fields[name] = row[i]}
+ yield line, fields if block_given?
+
name = row[field_names['name']]
email = row[field_names['request_email']]
next if name.nil?