Sha256: 699698d2dd3395a735aa7439bc38f5f451617d5674894215acea6a0325479ab8
Contents?: true
Size: 520 Bytes
Versions: 3
Compression:
Stored size: 520 Bytes
Contents
class MoveFeaturedAttributeOfProducts < CamaManager.migration_class def change Cama::Site.all.each do |site| ptype = site.post_types.where(slug: 'commerce').first if ptype.present? ptype.posts.filter_by_field('ecommerce_featured', value: '1').each do |post| post.update_column(:is_feature, true) end field = ptype.get_field_object('ecommerce_featured') field.destroy if field.present? ptype.set_option('has_featured', true) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems