ActiveRecord::RecordInvalid: A validação falhou: Comment markdown não pode ficar em branco (ActiveRecord::RecordInvalid)

Open
#13,096 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rails, ruby
Domain
backend

Research direction

The error is a validation failure on the Comment markdown field raised from API::Solutions::MentorRequestsController#create, so start in that controller and the Comment model's markdown validation. Reproduce by submitting a mentor request with an empty comment body and check how the controller handles the RecordInvalid exception. Done means the blank-comment case is handled deliberately and a test covers it.

Written by the indexing model from the issue text.

Description

Error

A validação falhou: Comment markdown não pode ficar em branco (ActiveRecord::RecordInvalid)

Stack trace

active_record/validations.rb:87 in raise_validation_error
active_record/validations.rb:54 in save!
active_record/transactions.rb:366 in block in ActiveRecord::Transactions#save!
active_record/transactions.rb:418 in block (2 levels) in ActiveRecord::Transactions#with_transaction_returning_status
active_record/connection_adapters/abstract/database_statements.rb:359 in transaction
active_record/transactions.rb:414 in block in ActiveRecord::Transactions#with_transaction_returning_status
active_record/connection_adapters/abstract/connection_pool.rb:425 in with_connection
active_record/connection_handling.rb:298 in with_connection
active_record/transactions.rb:410 in with_transaction_returning_status
active_record/transactions.rb:366 in save!

Tracking Details

Dominant language
Ruby
Stars
554
Forks
172
Avg merge
20h 23m
Merged PRs (30d)
73

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from exercism/website

All issues in exercism/website

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.