---
title: "Discussion on \"Before adding a new validation, one thing you should notice\" | Hashnode"
description: "Discussion on \"Before adding a new validation, one thing you should notice\". When we develop a new feature, it's common to add a new column that needs some validations in the model. So, we might write something like this:\nclass Book < ApplicationRecord\n  #...\n  validates :barcode, presence: true\nend\n\nTo increase the test cove..."
url: "https://hashnode.com/posts/before-adding-a-new-validation-one-thing-you-should-notice/65c47694d09eaa294dea77ae"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Before adding a new validation, one thing you should notice](https://lynnbright.com/before-adding-a-new-validation-one-thing-you-should-notice?utm_source=hashnode&utm_medium=feed)

When we develop a new feature, it's common to add a new column that needs some validations in the model. So, we might write something like this: class Book < ApplicationRecord #... validates :barcode, presence: true end To increase the test cove...

Jul 24, 2021 · 2 min read · lynnbright.com  
Read the article

## Written by

[Lynn Chang](https://hashnode.com/@Lynnbright)

@Lynnbright · Taipei, Taiwan

  
[View profile](https://hashnode.com/@Lynnbright)

Rails Developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
