f1479b56b7
In 8278b763d9
the default behaviour of annotation
has changes, which was causing a lot of noise in diffs. We decided in #17382
that it is better to get rid of the whole annotate gem, and instead let people
look at schema.rb for the columns in a table.
Fixes: #17382
21 lines
618 B
Ruby
21 lines
618 B
Ruby
require 'carrierwave/orm/activerecord'
|
|
|
|
class ProjectImportData < ActiveRecord::Base
|
|
belongs_to :project
|
|
attr_encrypted :credentials,
|
|
key: Gitlab::Application.secrets.db_key_base,
|
|
marshal: true,
|
|
encode: true,
|
|
mode: :per_attribute_iv_and_salt
|
|
|
|
serialize :data, JSON
|
|
|
|
validates :project, presence: true
|
|
|
|
before_validation :symbolize_credentials
|
|
|
|
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
|
|
end
|