Forum: Ruby on Rails update_all broken in postgres?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cac068c9c92719a59db960b2fa51719c?d=identicon&s=25 Iphan Iphan (iphan)
on 2006-06-01 11:04
Hi

has anyone managed to use update_all with rails on postgres?

In my setup, it does not work:

>> @keyword.update_all(myupdates)
NoMethodError: undefined method `update_all' for #<Keyword:0xb7ac4670>
        from
/home/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/base.rb:1786:in
`method_missing'
        from (irb):14


I checked that the base.rb class contains the update_all method, so it
seems like

        connection.update(sql, "#{name} Update")

isn't working
Cac068c9c92719a59db960b2fa51719c?d=identicon&s=25 Iphan Iphan (iphan)
on 2006-06-01 11:07
sorry just realised this is a class method, not an instance method!
Ed5307c79ba5b415b1ddfee48319099b?d=identicon&s=25 Ioana Kanda (Guest)
on 2006-06-01 11:11
(Received via mailing list)
update_all is for ActiveRecord...use class_name.update_all
This topic is locked and can not be replied to.