Ruby on Rails 2.3.5: update_all failing on ActiveRecord
Posted
by randombits
on Stack Overflow
See other posts from Stack Overflow
or by randombits
Published on 2010-05-06T23:03:23Z
Indexed on
2010/05/06
23:08 UTC
Read the original article
Hit count: 489
ruby-on-rails
|activerecord
I'm trying to update a collection of records in my database using ActiveRecord's update_all. Enter script/console.
MyModel.update_all("reserved = 1", :limit => 1000)
ActiveRecord thinks limit is a column, says it's unknown and throws an exception. According to the documentation though, my syntax looks sane. This is RoR 2.3.5.
When doing MyModel.update_all("reserved = 1")
alone, it works just fine.
© Stack Overflow or respective owner