Sha256: 6427ec1fa8bd0b8ea4775a8ca0e80e48d7827ffb5892038c84710e1e657c3cac

Contents?: true

Size: 481 Bytes

Versions: 2

Compression:

Stored size: 481 Bytes

Contents

class UpdateRelations < ActiveRecord::Migration
  def up
    Spree::Relation.where(relatable_type: 'Product').update_all(relatable_type: 'Spree::Product')
    Spree::Relation.where(related_to_type: 'Product').update_all(related_to_type: 'Spree::Product')
  end

  def down
    Spree::Relation.where(relatable_type: 'Spree::Product').update_all(relatable_type: 'Product')
    Spree::Relation.where(related_to_type: 'Spree::Product').update_all(related_to_type: 'Product')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solidus_related_products-1.1.0 db/migrate/20120623014337_update_relations.rb
solidus_related_products-1.0.0 db/migrate/20120623014337_update_relations.rb