Home »
MCQs »
Ruby on Rails MCQs
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?
- update_columns(attributes)
- update!(attributes)
- update_column(name, value)
- 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.