Skip to content

Commit

Permalink
sort by id order
Browse files Browse the repository at this point in the history
  • Loading branch information
jambun committed May 24, 2017
1 parent b10ba8a commit 94c7d10
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions backend/model/ladybird_export.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,15 @@ def to_stream
# fields required for the report. These values are stored as instance
# variables and as such many of the helper methods will only return data
# once `dataset` has been called.
all_rows = dataset.all
@ids.each do |id|
all_rows.select {|row| row[:archival_object_id] == id }.each do |row|
row_style = nil
dataset.all.sort{|x,y| @ids.index(x[:archival_object_id]) <=> @ids.index(y[:archival_object_id])}.each do |row|
row_style = nil

if has_digital_object_instances?(row[:archival_object_id])
row_style = highlight
end
if has_digital_object_instances?(row[:archival_object_id])
row_style = highlight
end

sheet.add_row column_definitions.map {|col| col[:proc].call(row) }, :style => row_style
sheet.add_row column_definitions.map {|col| col[:proc].call(row) }, :style => row_style

end
end
end

Expand Down

0 comments on commit 94c7d10

Please sign in to comment.