Leverage Regular Instance Variable to Resolve Thread-Safety Issue on Rails ActiveRecord model
24-Jan-2023 840
Owing to the superpowers of the Rails ActiveRecord module, developers can sometimes forget that, under the hood, our AR models are just regular Ruby objects. This allows us to make use of standard instance variables on the objects to adapt their behaviour, which can be useful in particular cases. In this post we discuss the technique and give an example of where it could be used.
Leverage Regular Instance Variable to Resolve Thread-Safety Issue on Rails ActiveRecord model #ruby #rubydeveloper #rubyonrails #Leverage #Regular #Instance #Variable #Resolve #Thread-Safety #Issue #Rails #ActiveRecord #model #activerecord #thread-safety https://rubyonrails.ba/link/leverage-regular-instance-variable-to-resolve-thread-safety-issue-on-rails-activerecord-model