Sha256: 8c0a2b2509c68e53da0ed1095067b4c7ab06ebf794a87be677955a3ad717adb7

Contents?: true

Size: 419 Bytes

Versions: 11

Compression:

Stored size: 419 Bytes

Contents

class SeedService
  class << self
    def seed
      service = SeedService.new
      service.call
    end
  end

  def call
    reset
    create
  end

  private

  def reset
    Person.delete_all
    Post.delete_all
    Project.delete_all
  end

  def create
    FactoryBot.create_list(:post, rand(10..20))
    FactoryBot.create_list(:person, rand(10..20))
    FactoryBot.create_list(:project, rand(10..20))
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rails_app_generator-0.3.6 after_templates/addons/factory_bot_rails/app/services/seed_service.rb
rails_app_generator-0.3.5 after_templates/addons/factory_bot_rails/app/services/seed_service.rb
rails_app_generator-0.3.4 after_templates/addons/factory_bot_rails/app/services/seed_service.rb
rails_app_generator-0.3.3 after_templates/addons/factory_bot_rails/app/services/seed_service.rb
rails_app_generator-0.3.2 after_templates/addons/factory_bot_rails/app/services/seed_service.rb
rails_app_generator-0.3.1 after_templates/addons/factory_bot_rails/app/services/seed_service.rb
rails_app_generator-0.3.0 after_templates/addons/factory_bot_rails/app/services/seed_service.rb
rails_app_generator-0.2.43 after_templates/addons/factory_bot_rails/app/services/seed_service.rb
rails_app_generator-0.2.42 after_templates/addons/factory_bot_rails/app/services/seed_service.rb
rails_app_generator-0.2.41 after_templates/addons/factory_bot_rails/app/services/seed_service.rb
rails_app_generator-0.2.40 after_templates/addons/factory_bot_rails/app/services/seed_service.rb