Sha256: 797e98bd278f00402952992f715f946daec183be2eb50abc5f93edb3e274e87e

Contents?: true

Size: 588 Bytes

Versions: 2

Compression:

Stored size: 588 Bytes

Contents

class AddVendorConsumerProductRolesToRoleType
  
  def self.up
    product_role = RoleType.find_by_internal_identifier('vendor')
    if product_role.nil?
      RoleType.create(:description => 'Vendor', :internal_identifier => 'vendor')
    end

    product_role = RoleType.find_by_internal_identifier('consumer')
    if product_role.nil?
      RoleType.create(:description => 'Consumer', :internal_identifier => 'consumer')
    end
  end
  
  def self.down
    RoleType.find_by_internal_identifier('vendor').destroy
    RoleType.find_by_internal_identifier('consumer').destroy
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
erp_products-4.2.0 db/data_migrations/20140130204915_add_vendor_consumer_product_roles_to_role_type.rb
erp_products-4.0.0 db/data_migrations/20140130204915_add_vendor_consumer_product_roles_to_role_type.rb