Class: BulkImports::Export
Constant Summary
collapse
- STARTED =
0
- FINISHED =
1
- FAILED =
-1
ApplicationRecord::MAX_PLUCK
HasCheckConstraints::NOT_NULL_CHECK_PATTERN
ResetOnColumnErrors::MAX_RESET_PERIOD
Instance Method Summary
collapse
===, cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, nullable_column?, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order
#reset_on_union_error, #reset_on_unknown_attribute_error
#serializable_hash
Instance Method Details
#config ⇒ Object
70
71
72
73
74
|
# File 'app/models/bulk_imports/export.rb', line 70
def config
strong_memoize(:config) do
FileTransfer.config_for(portable)
end
end
|
#portable ⇒ Object
60
61
62
63
64
|
# File 'app/models/bulk_imports/export.rb', line 60
def portable
strong_memoize(:portable) do
project || group
end
end
|
#portable_relation? ⇒ Boolean
54
55
56
57
58
|
# File 'app/models/bulk_imports/export.rb', line 54
def portable_relation?
return unless portable
errors.add(:relation, 'Unsupported portable relation') unless config.portable_relations.include?(relation)
end
|
#relation_definition ⇒ Object
66
67
68
|
# File 'app/models/bulk_imports/export.rb', line 66
def relation_definition
config.relation_definition_for(relation)
end
|
#relation_has_user_contributions? ⇒ Boolean
83
84
85
|
# File 'app/models/bulk_imports/export.rb', line 83
def relation_has_user_contributions?
config.relation_has_user_contributions?(relation)
end
|
#remove_existing_upload! ⇒ Object
76
77
78
79
80
81
|
# File 'app/models/bulk_imports/export.rb', line 76
def remove_existing_upload!
return unless upload&.export_file&.file
upload.remove_export_file!
upload.save!
end
|