Skip to content

Commit

Permalink
Merge pull request #20 from performant-software/feature/udf19_validat…
Browse files Browse the repository at this point in the history
…ion_exception

UDF #19 - Validation exception
  • Loading branch information
dleadbetter authored Sep 27, 2022
2 parents 4fff0bd + 69a90c7 commit 0cfd2bf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/models/concerns/user_defined_fields/fieldable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ def validate_user_defined_fields
next unless field.required?

# Parse the user defined field and extract the value
json = JSON.parse(self.user_defined || '{}')
value = json[field.column_name]
value = self.user_defined[field.column_name] if self.user_defined.present?

# Add an error if the value is "empty"
next unless value.nil? ||
Expand Down

0 comments on commit 0cfd2bf

Please sign in to comment.