diff --git a/app/jobs/regular/export_csv_file.rb b/app/jobs/regular/export_csv_file.rb index 308d5d37734..58ee9d6d94e 100644 --- a/app/jobs/regular/export_csv_file.rb +++ b/app/jobs/regular/export_csv_file.rb @@ -6,7 +6,7 @@ module Jobs class ExportCsvFile < Jobs::Base HEADER_ATTRS_FOR = {} HEADER_ATTRS_FOR['user_archive'] = ['topic_title','category','sub_category','is_pm','post','like_count','reply_count','url','created_at'] - HEADER_ATTRS_FOR['user'] = ['id','name','username','email','title','created_at','trust_level','active','admin','moderator','ip_address'] + HEADER_ATTRS_FOR['user_list'] = ['id','name','username','email','title','created_at','trust_level','active','admin','moderator','ip_address'] HEADER_ATTRS_FOR['user_stats'] = ['topics_entered','posts_read_count','time_read','topic_count','post_count','likes_given','likes_received'] HEADER_ATTRS_FOR['user_sso'] = ['external_id','external_email', 'external_username', 'external_name', 'external_avatar_url'] HEADER_ATTRS_FOR['staff_action'] = ['staff_user','action','subject','created_at','details', 'context'] @@ -105,8 +105,8 @@ module Jobs def get_header(entity) case entity - when 'user' - header_array = HEADER_ATTRS_FOR['user'] + HEADER_ATTRS_FOR['user_stats'] + when 'user_list' + header_array = HEADER_ATTRS_FOR['user_list'] + HEADER_ATTRS_FOR['user_stats'] if SiteSetting.enable_sso header_array.concat(HEADER_ATTRS_FOR['user_sso']) end @@ -172,7 +172,7 @@ module Jobs def get_user_list_fields(user) user_array = [] - HEADER_ATTRS_FOR['user'].each do |attr| + HEADER_ATTRS_FOR['user_list'].each do |attr| user_array.push(user.attributes[attr]) end diff --git a/spec/jobs/export_csv_file_spec.rb b/spec/jobs/export_csv_file_spec.rb index b18383c2367..457c9bcef28 100644 --- a/spec/jobs/export_csv_file_spec.rb +++ b/spec/jobs/export_csv_file_spec.rb @@ -9,7 +9,7 @@ describe Jobs::ExportCsvFile do end let :user_list_header do - Jobs::ExportCsvFile.new.get_header('user') + Jobs::ExportCsvFile.new.get_header('user_list') end let :user_list_export do