File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ class RefreshTokenJob < ApplicationJob
7
7
8
8
def perform ( identity )
9
9
identity . refresh_token!
10
+ return unless identity . airtable?
10
11
11
- AirtableShotUploadAllJob . set ( wait : 2 . minutes ) . perform_later ( identity . user ) if identity . airtable?
12
+ AirtableShotUploadAllJob . set ( wait : 2 . minutes ) . perform_later ( identity . user )
12
13
end
13
14
end
Original file line number Diff line number Diff line change @@ -20,12 +20,14 @@ def upload(shot)
20
20
if shot . airtable_id
21
21
update_record ( shot . airtable_id , prepare_record ( shot ) )
22
22
else
23
- upload_multiple ( ::Shot . where ( id : shot . id ) )
23
+ upload_multiple ( ::Shot . where ( user : , id : shot . id ) )
24
24
end
25
25
end
26
26
27
27
def upload_multiple ( shots )
28
- records = shots . where ( user :) . with_attached_image . map { |shot | prepare_record ( shot ) }
28
+ return unless shots . exists?
29
+
30
+ records = shots . with_attached_image . map { |shot | prepare_record ( shot ) }
29
31
update_records ( records ) do |response |
30
32
response [ "records" ] . each do |record |
31
33
shot = shots . find_by ( id : record [ "fields" ] [ "ID" ] )
You can’t perform that action at this time.
0 commit comments