diff options
Diffstat (limited to 'app/models/project_import_data.rb')
-rw-r--r-- | app/models/project_import_data.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/project_import_data.rb b/app/models/project_import_data.rb index fa6055ff64d..225cbda15b1 100644 --- a/app/models/project_import_data.rb +++ b/app/models/project_import_data.rb @@ -18,7 +18,11 @@ class ProjectImportData < ActiveRecord::Base validates :project, presence: true - def stringified_credentials - JSON[credentials.to_json] + # TODO: This doesnt play well with attr_encrypted. Perhaps consider extending Marshall and specify a different Marshaller + before_validation :symbolize_credentials + + def symbolize_credentials + return if credentials.blank? + credentials.deep_symbolize_keys! end end |