Class: ProjectImportData

Inherits:
ApplicationRecord show all
Defined in:
app/models/project_import_data.rb

Constant Summary collapse

OPTIMISTIC_TIMEOUT =

Timeout strategy can only be changed via API, currently only with GitHub and BitBucket Server

"optimistic"
PESSIMISTIC_TIMEOUT =
"pessimistic"
TIMEOUT_STRATEGIES =
[OPTIMISTIC_TIMEOUT, PESSIMISTIC_TIMEOUT].freeze

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Constants included from ResetOnUnionError

ResetOnUnionError::MAX_RESET_PERIOD

Instance Method Summary collapse

Methods inherited from ApplicationRecord

cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, 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

Methods included from SensitiveSerializableHash

#serializable_hash

Instance Method Details

#clear_credentialsObject



46
47
48
# File 'app/models/project_import_data.rb', line 46

def clear_credentials
  self.credentials = {}
end

#merge_credentials(hash) ⇒ Object



42
43
44
# File 'app/models/project_import_data.rb', line 42

def merge_credentials(hash)
  self.credentials = credentials.to_h.merge(hash) unless hash.empty?
end

#merge_data(hash) ⇒ Object



38
39
40
# File 'app/models/project_import_data.rb', line 38

def merge_data(hash)
  self.data = data.to_h.merge(hash) unless hash.empty?
end

#symbolize_credentialsObject



33
34
35
36
# File 'app/models/project_import_data.rb', line 33

def symbolize_credentials
  # bang doesn't work here - attr_encrypted makes it not to work
  self.credentials = self.credentials.deep_symbolize_keys unless self.credentials.blank?
end