Add details
to error response for POST /api/v1/accounts
in REST API (#15803)
This commit is contained in:
parent
b4cb8c3c83
commit
9aa37b32c3
12 changed files with 72 additions and 23 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
class NoteLengthValidator < ActiveModel::EachValidator
|
||||
def validate_each(record, attribute, value)
|
||||
record.errors.add(attribute, I18n.t('statuses.over_character_limit', max: options[:maximum])) if too_long?(value)
|
||||
record.errors.add(attribute, :too_long, message: I18n.t('statuses.over_character_limit', max: options[:maximum]), count: options[:maximum]) if too_long?(value)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue