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.
Iphan I. (Guest)
on 2006-06-01 13: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
Iphan I. (Guest)
on 2006-06-01 13:07
sorry just realised this is a class method, not an instance method!
Ioana K. (Guest)
on 2006-06-01 13: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.