---
title: "Discussion on \"Understanding Rails Callbacks & Common Pitfalls\" | Hashnode"
description: "Discussion on \"Understanding Rails Callbacks & Common Pitfalls\". Why you should be careful when using Callbacks in Rails and their hidden gotchas"
url: "https://hashnode.com/posts/understanding-rails-callbacks-common-pitfalls/654006edcf0027421c8ede20"
---

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

Discussion

# [Understanding Rails Callbacks & Common Pitfalls](https://www.dsdev.in/understanding-rails-callbacks-common-pitfalls?utm_source=hashnode&utm_medium=feed)

Why you should be careful when using Callbacks in Rails and their hidden gotchas

Oct 30, 2023 · 4 min read · dsdev.in  
Read the article

-   [#ruby-on-rails](https://hashnode.com/tag/ruby-on-rails)
-   [#callbacks](https://hashnode.com/tag/callbacks)
-   [#activerecord](https://hashnode.com/tag/activerecord)
-   [#ruby](https://hashnode.com/tag/ruby)

## Written by

[Dhaval Singh](https://hashnode.com/@DhavalSingh)

@DhavalSingh · Bangalore, India

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

Writing about Software Development, Backend in particular!

## Responses 1

Markdown supported · ⌘↵ to post

[Serguei Cambour](https://hashnode.com/@belgoros)

[Nov 4, 2023](https://hashnode.com/posts/understanding-rails-callbacks-common-pitfalls/654006edcf0027421c8ede20/comment/654611f831ab12d0f49f0a0c)

Thank you so much for sharing such useful tips. One point: you have a tiny typo in Comapny.find\_by!(name:...), - it should be Company, I suppose :).

Also in the `Brake#do_brake` method, I don't think the call `puts "Brake id: #{self.brake.id}"` to correct, - you are calling `brake` on the instance of the `Brake` class instead of just calling `id` method.

[江 九](https://hashnode.com/@wzg)

[Oct 31, 2023](https://hashnode.com/posts/understanding-rails-callbacks-common-pitfalls/654006edcf0027421c8ede20/comment/6540b5589ba50faa87403173)

Hello, I want to find a partner to make a video player software, please contact me at jj5372035gmail.c o m

[江 九](https://hashnode.com/@wzg)

[Oct 31, 2023](https://hashnode.com/posts/understanding-rails-callbacks-common-pitfalls/654006edcf0027421c8ede20/comment/6540b45d9ba50faa87403144)

Hello, I want to find a partner to make a video player software, please contact me at jj5372035gmail.c o m
