20300: Change deprecated update_attributes to update.
[arvados.git] / services / api / db / migrate / 20130118002239_rename_metadata_attributes.rb
index 049b5e2d639baa303ee36f404defb73482402ed4..2c1b4060007914778625cb0c31001cbec1b11219 100644 (file)
@@ -17,7 +17,7 @@ class RenameMetadataAttributes < ActiveRecord::Migration[4.2]
       Metadatum.where('head like ?', 'orvos#%').each do |m|
         kind_uuid = m.head.match /^(orvos\#.*)\#([-0-9a-z]+)$/
         if kind_uuid
-          m.update_attributes(head_kind: kind_uuid[1],
+          m.update(head_kind: kind_uuid[1],
                               head: kind_uuid[2])
         end
       end
@@ -28,7 +28,7 @@ class RenameMetadataAttributes < ActiveRecord::Migration[4.2]
   def down
     begin
       Metadatum.where('head_kind is not null and head_kind <> ? and head is not null', '').each do |m|
-        m.update_attributes(head: m.head_kind + '#' + m.head)
+        m.update(head: m.head_kind + '#' + m.head)
       end
     rescue
     end