How to download belongs_to to work twice as fast (database_validations gem)

In this article, I will show why you need to use db_belongs_to from 3r3118. database_validations heme instead of the usual belongs_to . 3r33130. database_validations gem . This heme already included validates_db_uniqueness_of , which people liked ( post on Habré ) and now has db_belongs_to which is very easy to implement in your project. db_belongs_to improves performance and ensures data integrity. 3r33130. 3r3125.  

The method does several things for you:

    3r3111. Checks for the existence of a valid foreign key constraint in the database when the application is started; 3r33112.  
    3r3111. Parsing database exceptions and provides corresponding errors for 3r3107. errors your object; 3r33112.  
    3r3111. Eliminates the need to execute unnecessary SQL database queries; 3r33112.  
    3r3114. 3r3125.  
    I recommend you use r3r3118. database_validations
    in your projects. This gem has already been tested in a production environment and has shown itself to be very good. Despite its ease of implementation, it can greatly improve the performance of your project, because 3r3128. the more you use it, the more you keep
    read 3r3122. group benchmarks
    for details. 3r33130. 3r3125.  
    3r3128. Any feedback is welcome! Appreciate any contribution to the project!
    3r33130. 3r3138.
+ 0 -

Add comment