Sha256: 2ac92bca387d97906d01638466ac453609eaa64761fa86c7730d3389773ab0ee

Contents?: true

Size: 566 Bytes

Versions: 12

Compression:

Stored size: 566 Bytes

Contents

class SeedService
  class << self
    def seed(variant: :reset)
      service = SeedService.new
      service.call(variant: variant)
    end
  end

  def call(variant: :reset)
    reset     if variant == :reset
    refresh   if variant == :refresh
    create
  end

  private

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

  def refresh
  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

12 entries across 5 versions & 1 rubygems

Version Path
rails_app_generator-0.3.6 after_templates/addons/rspec/app/services/seed_service.rb
rails_app_generator-0.3.6 templates/thor_task/profile/app/services/seed_service.rb
rails_app_generator-0.3.6 after_templates/addons/view_component/app/services/seed_service.rb
rails_app_generator-0.3.5 after_templates/addons/rspec/app/services/seed_service.rb
rails_app_generator-0.3.5 after_templates/addons/view_component/app/services/seed_service.rb
rails_app_generator-0.3.5 templates/thor_task/profile/app/services/seed_service.rb
rails_app_generator-0.3.4 after_templates/addons/rspec/app/services/seed_service.rb
rails_app_generator-0.3.4 after_templates/addons/view_component/app/services/seed_service.rb
rails_app_generator-0.3.4 templates/thor_task/profile/app/services/seed_service.rb
rails_app_generator-0.3.3 templates/thor_task/profile/app/services/seed_service.rb
rails_app_generator-0.3.3 after_templates/addons/rspec/app/services/seed_service.rb
rails_app_generator-0.3.2 templates/thor_task/profile/app/services/seed_service.rb