Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update freecen_csv_file.rb #2669

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/controllers/freecen2_pieces_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ def enter_number
def export_csv
@chapman_code = session[:chapman_code]
@year = params[:csvdownload][:year]
p "AEV01 #{@chapman_code}"
p "AEV02 #{@year}"
success, message, file_location, file_name = Freecen2Piece.create_csv_export_listing(@chapman_code, @year)

if success
Expand Down
6 changes: 3 additions & 3 deletions app/models/freecen1_vld_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,11 @@ def compute_ecclesiastical_parish(rec)

def compute_where_census_taken(rec)
if !@use_blank
line = rec['ecclesiastical_parish'] if rec['ecclesiastical_parish'].present?
line = rec['civil_parish'] if rec['civil_parish'].present? && rec['ecclesiastical_parish'].blank?
line = rec['ecclesiastical_parish'] if rec['ecclesiastical_parish'].present? && rec['ecclesiastical_parish'] != '-'
line = rec['civil_parish'] if rec['civil_parish'].present? && (rec['ecclesiastical_parish'].blank? || rec['ecclesiastical_parish'] == '-')
@initial_line_hash['where_census_taken'] = line
else
if rec['ecclesiastical_parish'].present? && rec['ecclesiastical_parish'] == @initial_line_hash['where_census_taken']
if rec['ecclesiastical_parish'].present? && rec['ecclesiastical_parish'] != '-' && rec['ecclesiastical_parish'] == @initial_line_hash['where_census_taken']
line = @blank
elsif rec['civil_parish'].present? && rec['civil_parish'] == @initial_line_hash['where_census_taken']
line = @blank
Expand Down
2 changes: 1 addition & 1 deletion app/models/freecen_csv_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ def check_for_british(notes)
end

def compute_enumeration_district(rec)
if rec['enumeration_district'] == @initial_line_hash['enumeration_district']
if rec['enumeration_district'] == @initial_line_hash['enumeration_district'] && rec['civil_parish'] == @initial_line_hash['civil_parish'] && !@initial_line_hash['civil_parish'].blank?
line = @blank
@use_blank = true
else
Expand Down