diff --git a/app/models/application_model/checks_attribute_values_and_length.rb b/app/models/application_model/checks_attribute_values_and_length.rb index d6739a14d..2cc92eeda 100644 --- a/app/models/application_model/checks_attribute_values_and_length.rb +++ b/app/models/application_model/checks_attribute_values_and_length.rb @@ -18,7 +18,6 @@ module ApplicationModel::ChecksAttributeValuesAndLength def check_attribute_values_and_length columns = self.class.columns_hash attributes.each do |name, value| - next if value.blank? next if !value.instance_of?(String) column = columns[name] next if !column @@ -27,6 +26,8 @@ module ApplicationModel::ChecksAttributeValuesAndLength self[name].force_encoding('BINARY') end + next if value.blank? + # strip null byte chars (postgresql will complain about it) if column.type == :text if Rails.application.config.db_null_byte == false