Class: ProjectImportData

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

Constant Summary

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

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


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

def clear_credentials
  self.credentials = {}
end

#merge_credentials(hash) ⇒ Object


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

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

#merge_data(hash) ⇒ Object


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

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

#symbolize_credentialsObject


28
29
30
31
# File 'app/models/project_import_data.rb', line 28

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