Which of the following is the fastest way to update attributes (in Ruby on Rails)?

31. Which of the following is the fastest way to update attributes?

  1. update_columns(attributes)
  2. update!(attributes)
  3. update_column(name, value)
  4. update_attribute(name, value)

Answer: A) update_columns(attributes)

Explanation:

update columns(attributes) is the fastest way to update attributes because it goes straight to the database.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.