diff options
Diffstat (limited to 'app/models/bulk_imports/entity.rb')
-rw-r--r-- | app/models/bulk_imports/entity.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/bulk_imports/entity.rb b/app/models/bulk_imports/entity.rb index bb543b39a79..24f86b44841 100644 --- a/app/models/bulk_imports/entity.rb +++ b/app/models/bulk_imports/entity.rb @@ -48,6 +48,8 @@ class BulkImports::Entity < ApplicationRecord enum source_type: { group_entity: 0, project_entity: 1 } + scope :by_user_id, ->(user_id) { joins(:bulk_import).where(bulk_imports: { user_id: user_id }) } + state_machine :status, initial: :created do state :created, value: 0 state :started, value: 1 @@ -68,6 +70,10 @@ class BulkImports::Entity < ApplicationRecord end end + def self.all_human_statuses + state_machine.states.map(&:human_name) + end + def encoded_source_full_path ERB::Util.url_encode(source_full_path) end |