Class: DeviseFidoUsf::Generators::MigrateGenerator

Inherits:
ActiveRecord::Generators::Base
  • Object
show all
Defined in:
lib/generators/devise_fido_usf/migrate_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_fido_usf_device_migrationObject



12
13
14
# File 'lib/generators/devise_fido_usf/migrate_generator.rb', line 12

def copy_fido_usf_device_migration
  migration_template "migration.rb", "db/migrate/create_#{table_name}.rb", migration_version: migration_version
end

#migration_versionObject



20
21
22
23
24
# File 'lib/generators/devise_fido_usf/migrate_generator.rb', line 20

def migration_version
  if rails5?
    "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
  end
end

#rails5?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/generators/devise_fido_usf/migrate_generator.rb', line 16

def rails5?
  Rails.version.start_with? '5'
end