Skip to content

Commit

Permalink
Maintain backwards compatibility with Rails apps using < 6.1.0 in cal…
Browse files Browse the repository at this point in the history
…ling Run#has_one_attached (#385)
  • Loading branch information
adrianna-chang-shopify authored Mar 29, 2021
1 parent bcce741 commit b761430
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/models/maintenance_tasks/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ class Run < ApplicationRecord

validates_with RunStatusValidator, on: :update

has_one_attached :csv_file, service: MaintenanceTasks.active_storage_service
if MaintenanceTasks.active_storage_service.present?
has_one_attached :csv_file,
service: MaintenanceTasks.active_storage_service
else
has_one_attached :csv_file
end

# Sets the run status to enqueued, making sure the transition is validated
# in case it's already enqueued.
Expand Down

0 comments on commit b761430

Please sign in to comment.