Class: BulkImports::UserContributionsExportService

Inherits:
Object
  • Object
show all
Defined in:
app/services/bulk_imports/user_contributions_export_service.rb

Instance Method Summary collapse

Constructor Details

#initialize(user_id, portable, jid) ⇒ UserContributionsExportService

Returns a new instance of UserContributionsExportService.



5
6
7
8
9
# File 'app/services/bulk_imports/user_contributions_export_service.rb', line 5

def initialize(user_id, portable, jid)
  @user = User.find(user_id)
  @portable = portable
  @jid = jid
end

Instance Method Details

#executeObject



11
12
13
14
15
16
17
# File 'app/services/bulk_imports/user_contributions_export_service.rb', line 11

def execute
  # Set up query to get cached users and set it as user_contributions on the portable model
  @portable.user_contributions = UserContributionsExportMapper.new(@portable).get_contributing_users
  relation = BulkImports::FileTransfer::BaseConfig::USER_CONTRIBUTIONS_RELATION

  RelationExportService.new(@user, @portable, relation, @jid).execute
end