Class: NavvyGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/navvy_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



13
14
15
# File 'lib/generators/navvy_generator.rb', line 13

def self.source_root
  File.join(File.dirname(__FILE__), '..', '..', 'generators', 'navvy', 'templates')
end

Instance Method Details

#install_navvyObject



17
18
19
20
21
22
# File 'lib/generators/navvy_generator.rb', line 17

def install_navvy
  migration_template(
    "#{orm}_migration.rb",
    'db/migrate/create_jobs.rb'
  )
end

#ormObject



24
25
26
# File 'lib/generators/navvy_generator.rb', line 24

def orm
  options[:sequel] ? 'sequel' : 'active_record'
end