Sha256: 9051c35f17931447b0dec17167559497b94d61315c7e358247a4673e6efc612a

Contents?: true

Size: 647 Bytes

Versions: 15

Compression:

Stored size: 647 Bytes

Contents

class VolontariatSeed < DbSeed
  USER_ROLES = {
    master: {},
    admin: {},
    project_owner: {},
    user: {}
  }
  
  def create_fixtures
    super
    
    create_areas
    create_products
    
    # should send notifications to stream and email
  end
  
  private
  
  def create_areas
    Area.create!(
      [ 
        { name: 'General' },
        { name: 'Software Engineering' }
      ]
    )
  end
  
  def create_products
    product = Product.new(
      name: 'Text Creation', text: 'Dummy', area_ids: [Area.where(name: 'General').first.id]
    )
    product.user_id = User.where(name: 'Master').first.id
    product.save!
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
voluntary-0.4.0 lib/generators/voluntary/install/templates/lib/volontariat_seed.rb
voluntary-0.3.0 lib/generators/voluntary/install/templates/lib/volontariat_seed.rb
voluntary-0.2.4 lib/generators/voluntary/install/templates/lib/volontariat_seed.rb
voluntary-0.2.3 lib/generators/voluntary/install/templates/lib/volontariat_seed.rb
voluntary-0.2.2 lib/generators/voluntary/install/templates/lib/volontariat_seed.rb
voluntary-0.2.1 lib/generators/voluntary/install/templates/lib/volontariat_seed.rb
voluntary-0.2.0 lib/generators/voluntary/install/templates/lib/volontariat_seed.rb
voluntary-0.1.0 lib/generators/voluntary/install/templates/lib/volontariat_seed.rb
voluntary-0.1.0.rc4 lib/generators/voluntary/install/templates/lib/volontariat_seed.rb
voluntary-0.1.0.rc3 lib/generators/voluntary/install/templates/lib/volontariat_seed.rb
voluntary-0.1.0.rc2 lib/generators/voluntary/install/templates/lib/volontariat_seed.rb
voluntary-0.1.0.rc1 lib/generators/voluntary/install/templates/lib/volontariat_seed.rb
voluntary-0.0.3 lib/generators/voluntary/install/templates/lib/volontariat_seed.rb
voluntary-0.0.2 lib/generators/voluntary/install/templates/lib/volontariat_seed.rb
voluntary-0.0.1 lib/generators/voluntary/install/templates/lib/volontariat_seed.rb