Class: Hyrax::RequiredDataSeeder

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

Overview

This class was created for use in rake tasks and db/seeds.rb. It generates required repository metadata including Admin Set and User collection types and the default admin set.

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logger: Logger.new(STDOUT)) ⇒ RequiredDataSeeder

Returns a new instance of RequiredDataSeeder.


12
13
14
# File 'app/utils/hyrax/required_data_seeder.rb', line 12

def initialize(logger: Logger.new(STDOUT))
  @logger = logger
end

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.


10
11
12
# File 'app/utils/hyrax/required_data_seeder.rb', line 10

def logger
  @logger
end

Instance Method Details

#generate_seed_dataObject


16
17
18
19
# File 'app/utils/hyrax/required_data_seeder.rb', line 16

def generate_seed_data
  Hyrax::RequiredDataSeeders::CollectionTypeSeeder.generate_seeds(logger: logger)
  Hyrax::RequiredDataSeeders::CollectionSeeder.generate_seeds(logger: logger)
end