Module: DbMailerRails::Generators::Helpers::MigrationHelper

Included in:
InstallGenerator
Defined in:
lib/generators/db_mailer_rails/helpers/migration_helper.rb

Instance Method Summary collapse

Instance Method Details

#migration_destination_pathObject



13
14
15
# File 'lib/generators/db_mailer_rails/helpers/migration_helper.rb', line 13

def migration_destination_path
  File.join(destination_root, migration_path, "create_#{table_name}.rb")
end

#migration_pathObject



5
6
7
8
9
10
11
# File 'lib/generators/db_mailer_rails/helpers/migration_helper.rb', line 5

def migration_path
  if Rails.version >= '5.0.3'
    db_migrate_path
  else
    'db/migrate'
  end
end

#migration_versionObject



17
18
19
20
21
# File 'lib/generators/db_mailer_rails/helpers/migration_helper.rb', line 17

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