diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-03 18:09:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-03 18:09:46 +0300 |
commit | bbd9e2c915c46920ceb51376db19599cbf9ba836 (patch) | |
tree | 897c9abbe0afa31f077dd7ca7c76ba755b75237a /app/models/group_import_state.rb | |
parent | f145ef4be75f3711c52a680b86d96568e9acf385 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/group_import_state.rb')
-rw-r--r-- | app/models/group_import_state.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/group_import_state.rb b/app/models/group_import_state.rb index 89602e40357..c47ae3a80ba 100644 --- a/app/models/group_import_state.rb +++ b/app/models/group_import_state.rb @@ -3,6 +3,8 @@ class GroupImportState < ApplicationRecord self.primary_key = :group_id + MAX_ERROR_LENGTH = 255 + belongs_to :group, inverse_of: :import_state belongs_to :user, optional: false @@ -30,7 +32,7 @@ class GroupImportState < ApplicationRecord after_transition any => :failed do |state, transition| last_error = transition.args.first - state.update_column(:last_error, last_error) if last_error + state.update_column(:last_error, last_error.truncate(MAX_ERROR_LENGTH)) if last_error end end |