Class: Hyrax::RequiredDataSeeders::CollectionSeeder

Inherits:
Object
  • Object
show all
Defined in:
app/utils/hyrax/required_data_seeders/collection_seeder.rb

Overview

This class was created for use in rake tasks and db/seeds.rb. It generates collections that are required for all Hyrax applications.

Seeders of required data are non-destructive. If the data already exists, it will not be replaced.

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject

Returns the value of attribute logger.



13
14
15
# File 'app/utils/hyrax/required_data_seeders/collection_seeder.rb', line 13

def logger
  @logger
end

Class Method Details

.generate_seeds(logger: Logger.new(STDOUT)) ⇒ Object



15
16
17
18
19
20
21
22
# File 'app/utils/hyrax/required_data_seeders/collection_seeder.rb', line 15

def generate_seeds(logger: Logger.new(STDOUT))
  @logger = logger

  logger.info("Adding required collections...")

  default_admin_set = Hyrax::AdminSetCreateService.find_or_create_default_admin_set
  logger.info "   #{default_admin_set.title.first} -- FOUND OR CREATED"
end