active_record

Understanding Locking in Rails ActiveRecord

Data consistency is very important in many applications, especially for application related to finance, banking, etc. A small error could become a tragedy if we do not treat it seriously. This time, I am going to talk a bit about Locking and how you can use it to protect data…

Skip ActiveRecord callbacks

Callbacks are great and many business rules are often implemented in those callbacks to maintain data consistency and perform useful actions in app. As you might know, we can define several kinds of callbacks in ActiveRecord model, refer to the following guide for more detailed information: http://guides.rubyonrails.org/…