Advantage of using find_each and find_in_batches in rails
Usually when we want to loop through all rows of an active record model, we do User.all.each { |user| user.update_role } But when we do this in Rails console, it loads all the User objects in to memory and performs the action. Performance of the application will go down if number of users is more. To […]
Read more "Advantage of using find_each and find_in_batches in rails"