Sha256: 3f94f27a3d5093f71cfe92e0b436d785d24344eec772507c2496e57dd6ef492d
Contents?: true
Size: 933 Bytes
Versions: 26
Compression:
Stored size: 933 Bytes
Contents
# LandingPage used to support static pages, we've moved to a static # event. This adds path to promotions then migrates the old LandingPage rules class ContentVisitedEvent < ActiveRecord::Migration # Removed Class for Migrations class Spree::Promotion::Rules::LandingPage < Spree::PromotionRule preference :path, :string def eligible?(order, options = {}) true end end def up add_column :spree_activators, :path, :string Spree::Promotion::Rules::LandingPage.all.each do |promotion_rule| promotion = promotion_rule.promotion say "migrating #{promotion.name} promotion to use 'spree.content.visited' event" promotion.event_name = 'spree.content.visited' promotion.path = promotion_rule.preferred_path promotion.promotion_rules.delete promotion_rule promotion.save(:validate => false) end end def down remove_column :spree_activators, :path end end
Version data entries
26 entries across 26 versions & 1 rubygems