mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-02-23 00:23:02 +01:00
24 lines
519 B
Ruby
24 lines
519 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
require "use_case/data_export/base"
|
||
|
|
||
|
module UseCase
|
||
|
module DataExport
|
||
|
class InboxEntries < UseCase::DataExport::Base
|
||
|
def files = {
|
||
|
"inbox_entries.json" => json_file!(
|
||
|
inbox_entries: user.inboxes.map(&method(:collect_inbox_entry))
|
||
|
)
|
||
|
}
|
||
|
|
||
|
def collect_inbox_entry(inbox_entry)
|
||
|
{}.tap do |h|
|
||
|
column_names(::Inbox).each do |field|
|
||
|
h[field] = inbox_entry[field]
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|