Merge pull request #681 from mlorb/ml_sci_1351

fix errors in repo table [SCI-1351]
This commit is contained in:
Luka Murn 2017-06-13 18:28:11 +02:00 committed by GitHub
commit aa749cfd23
2 changed files with 4 additions and 3 deletions

View file

@ -670,7 +670,7 @@ function onClickSave() {
if (input) { if (input) {
input.closest('.form-group').addClass('has-error'); input.closest('.form-group').addClass('has-error');
input.parent().append("<span class='help-block'>" + input.parent().append("<span class='help-block'>" +
val.value[0] + '<br /></span>'); val.data[0] + '<br /></span>');
} }
}); });
}); });

View file

@ -39,7 +39,7 @@ class RepositoryRowsController < ApplicationController
) )
unless cell_value.save unless cell_value.save
errors[:repository_cells] << { errors[:repository_cells] << {
"#{cell.repository_column.id}": cell_value.errors.messages "#{column.id}": cell_value.errors.messages
} }
raise ActiveRecord::RecordInvalid raise ActiveRecord::RecordInvalid
end end
@ -106,7 +106,8 @@ class RepositoryRowsController < ApplicationController
existing.value.data = value existing.value.data = value
unless existing.value.save unless existing.value.save
errors[:repository_cells] << { errors[:repository_cells] << {
"#{cell.repository_column_id}": existing.value.errors.messages "#{existing.repository_column_id}":
existing.value.errors.messages
} }
raise ActiveRecord::RecordInvalid raise ActiveRecord::RecordInvalid
end end