Sha256: 680494854a1632d3fabed537eb6bbc3730a316aa8124d1ece2976a94de47e043
Contents?: true
Size: 283 Bytes
Versions: 11
Compression:
Stored size: 283 Bytes
Contents
class AddPositionToImages < ActiveRecord::Migration def self.up add_column :images, :position, :integer Image.all.each_with_index do |image, i| image.update_attribute('position', i+1) end end def self.down remove_column :images, :position end end
Version data entries
11 entries across 11 versions & 1 rubygems