Update record by conditions Ruby on Rails -


can update record conditions without check record first?

yes, method update_all.

# update books 'rails' in title book.update_all "author = 'david'", "title '%rails%'" 

http://apidock.com/rails/activerecord/relation/update_all


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -