Sha256: 921373da617e54e7cf1b41965cdb20cf3dc654246a400e7aa02ae35ab7028d37

Contents?: true

Size: 600 Bytes

Versions: 8

Compression:

Stored size: 600 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.erb', "#{options[:path]}/#{file_name}.rb")
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
scrivito_sdk-0.18.1 lib/generators/cms/migration/migration_generator.rb
scrivito_sdk-0.18.0 lib/generators/cms/migration/migration_generator.rb
scrivito_sdk-0.17.0 lib/generators/cms/migration/migration_generator.rb
scrivito_sdk-0.16.0 lib/generators/cms/migration/migration_generator.rb
scrivito_sdk-0.15.0 lib/generators/cms/migration/migration_generator.rb
scrivito_sdk-0.14.0 lib/generators/cms/migration/migration_generator.rb
scrivito_sdk-0.13.0 lib/generators/cms/migration/migration_generator.rb
scrivito_sdk-0.12.0 lib/generators/cms/migration/migration_generator.rb