Sha256: 2d3c24d704241e27c86c55d4ccbc0675b8024b25ca12ec771d640ca9786aecd8

Contents?: true

Size: 354 Bytes

Versions: 85

Compression:

Stored size: 354 Bytes

Contents

class AddDescriptionToLineItem < ActiveRecord::Migration
  def up
    add_column :line_items, :description, :string, :null => false, :default => ''

    Piggybak::LineItem.all.each do |line_item|
      line_item.update_attribute(:description, line_item.variant.description)
    end
  end

  def down
    remove_column :line_items, :description
  end
end

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
piggybak-0.7.7 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.7.6 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.7.5 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.6.34 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.7.4 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.7.3 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.7.2 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.7.1 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.7.0 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.6.33 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.6.32 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.6.31 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.6.30 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.6.29 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.6.28 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.6.27 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.6.26 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.6.25 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.6.24 db/migrate/20120627173754_add_description_to_line_item.rb
piggybak-0.6.23 db/migrate/20120627173754_add_description_to_line_item.rb