Sha256: 48f7bf7e77eb04e7e037870a7b258b3d7eceee48d1cb8c6c95a5e282b8593595

Contents?: true

Size: 596 Bytes

Versions: 6

Compression:

Stored size: 596 Bytes

Contents

module Cms
  class MigrationGenerator < ::Rails::Generators::NamedBase
    include ::Rails::Generators::Migration

    source_root File.expand_path('../templates', __FILE__)

    class_option :path,
      type: :string,
      default: 'cms/migrate',
      desc: 'Relative path to Rails.root where to place the migration file. Defaults to "cms/migrate".',
      banner: 'PATH'

    def self.next_migration_number(dirname)
      Time.now.utc.strftime('%Y%m%d%H%M%S')
    end

    def create_migration_file
      migration_template('migration.rb', "#{options[:path]}/#{file_name}")
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
infopark_cloud_connector-6.9.5 lib/generators/cms/migration/migration_generator.rb
infopark_cloud_connector-6.9.4 lib/generators/cms/migration/migration_generator.rb
infopark_cloud_connector-6.9.3.1.36404185 lib/generators/cms/migration/migration_generator.rb
infopark_cloud_connector-6.9.2.1.125136549 lib/generators/cms/migration/migration_generator.rb
infopark_cloud_connector-6.9.1.3.22208381 lib/generators/cms/migration/migration_generator.rb
infopark_cloud_connector-6.9.0.3.197272233 lib/generators/cms/migration/migration_generator.rb