Class: ActiveFedora::Noid::SeedGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/active_fedora/noid/seed_generator.rb

Instance Method Summary collapse

Instance Method Details


13
14
15
# File 'lib/generators/active_fedora/noid/seed_generator.rb', line 13

def banner
  say_status('info', "Initializing database table for namespace:template of '#{namespace}:#{template}'", :blue)
end

#checksObject


17
18
19
20
# File 'lib/generators/active_fedora/noid/seed_generator.rb', line 17

def checks
  say_status('warn', "Be sure to use an initializer to do 'ActiveFedora::Noid.config.namespace = #{namespace}'", :red) if namespace != ActiveFedora::Noid.config.namespace
  say_status('warn', "Be sure to use an initializer to do 'ActiveFedora::Noid.config.template = #{template}'", :red) if template != ActiveFedora::Noid.config.template
end

#seed_rowObject


22
23
24
25
26
27
# File 'lib/generators/active_fedora/noid/seed_generator.rb', line 22

def seed_row
  MinterState.seed!(
    namespace: namespace,
    template: template
  )
end