File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
app/resources/api/v3/public Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ module Public
4
4
class Api ::V3 ::Public ::IllustratorResource < JSONAPI ::Resource
5
5
immutable
6
6
7
- attributes :name , :updated_at
7
+ attributes :name , :num_printings , : updated_at
8
8
key_type :string
9
9
10
10
paginator :none
Original file line number Diff line number Diff line change @@ -339,6 +339,7 @@ namespace :cards do
339
339
340
340
illustrators = Set [ ]
341
341
illustrators_to_printings = [ ]
342
+ illustrator_num_printings = { }
342
343
num_its = 0
343
344
printings = Printing . all
344
345
printings . each { |printing |
@@ -350,6 +351,10 @@ namespace :cards do
350
351
"illustrator_id" : text_to_id ( i ) ,
351
352
"printing_id" : printing . id
352
353
}
354
+ if !illustrator_num_printings . key? ( i )
355
+ illustrator_num_printings [ i ] = 0
356
+ end
357
+ illustrator_num_printings [ i ] += 1
353
358
}
354
359
end
355
360
}
@@ -358,7 +363,8 @@ namespace :cards do
358
363
illustrators . each { |i |
359
364
ill << {
360
365
"id" : text_to_id ( i ) ,
361
- "name" : i
366
+ "name" : i ,
367
+ "num_printings" : illustrator_num_printings [ i ]
362
368
}
363
369
}
364
370
You can’t perform that action at this time.
0 commit comments