diff options
Diffstat (limited to 'app/models/bulk_imports/entity.rb')
-rw-r--r-- | app/models/bulk_imports/entity.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/bulk_imports/entity.rb b/app/models/bulk_imports/entity.rb index cad2fafe640..e0a616b5fb4 100644 --- a/app/models/bulk_imports/entity.rb +++ b/app/models/bulk_imports/entity.rb @@ -52,9 +52,11 @@ class BulkImports::Entity < ApplicationRecord scope :by_user_id, ->(user_id) { joins(:bulk_import).where(bulk_imports: { user_id: user_id }) } scope :stale, -> { where('created_at < ?', 8.hours.ago).where(status: [0, 1]) } - scope :by_bulk_import_id, ->(bulk_import_id) { where(bulk_import_id: bulk_import_id)} + scope :by_bulk_import_id, ->(bulk_import_id) { where(bulk_import_id: bulk_import_id) } scope :order_by_created_at, -> (direction) { order(created_at: direction) } + alias_attribute :destination_slug, :destination_name + state_machine :status, initial: :created do state :created, value: 0 state :started, value: 1 |