2020-10-23 15:08:42 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module BulkImports
|
|
|
|
module Pipeline
|
|
|
|
class Context
|
2021-02-02 18:09:42 +00:00
|
|
|
attr_reader :entity, :bulk_import
|
2021-02-15 21:08:59 +00:00
|
|
|
attr_accessor :extra
|
2020-10-23 15:08:42 +00:00
|
|
|
|
2021-02-15 21:08:59 +00:00
|
|
|
def initialize(entity, extra = {})
|
2021-02-02 18:09:42 +00:00
|
|
|
@entity = entity
|
|
|
|
@bulk_import = entity.bulk_import
|
2021-02-15 21:08:59 +00:00
|
|
|
@extra = extra
|
2020-10-23 15:08:42 +00:00
|
|
|
end
|
|
|
|
|
2021-02-02 18:09:42 +00:00
|
|
|
def group
|
|
|
|
entity.group
|
|
|
|
end
|
2020-10-23 15:08:42 +00:00
|
|
|
|
2021-02-02 18:09:42 +00:00
|
|
|
def current_user
|
|
|
|
bulk_import.user
|
2020-10-23 15:08:42 +00:00
|
|
|
end
|
|
|
|
|
2021-02-02 18:09:42 +00:00
|
|
|
def configuration
|
|
|
|
bulk_import.configuration
|
2020-10-23 15:08:42 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|