Skip to content

Commit

Permalink
Sometimes AR doesn't return the expression :/
Browse files Browse the repository at this point in the history
  • Loading branch information
lparry committed Oct 13, 2022
1 parent 93a2eba commit 296fbfe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/annotate/annotate_models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,9 @@ def get_check_constraint_info(klass, options = {})
max_size = check_constraints.map { |check_constraint| check_constraint.name.size }.max + 1
check_constraints.sort_by(&:name).each do |check_constraint|
cc_info << if options[:format_markdown]
sprintf("# * `%s`: `(%s)`\n", check_constraint.name, check_constraint.expression.squish)
sprintf("# * `%s`: `(%s)`\n", check_constraint.name, check_constraint.expression.to_s.squish)
else
sprintf("# %-#{max_size}.#{max_size}s (%s)\n", check_constraint.name, check_constraint.expression.squish)
sprintf("# %-#{max_size}.#{max_size}s (%s)\n", check_constraint.name, check_constraint.expression.to_s.squish)
end
end

Expand Down

0 comments on commit 296fbfe

Please sign in to comment.