Sha256: 1747338cf35de97653dd4708a5ae56630209c256a89cd3c1af629687c188b873

Contents?: true

Size: 616 Bytes

Versions: 7

Compression:

Stored size: 616 Bytes

Contents

require 'rails/generators'

class ExvoGlobalizeGenerator < Rails::Generators::Base
  desc "Add a 'create_globalize_translations' migration"

  include Rails::Generators::Migration

  def self.source_root
    @source_root ||= File.join(File.dirname(__FILE__), 'templates')
  end

  def self.next_migration_number(dirname)
    if ActiveRecord::Base.timestamped_migrations
      Time.now.utc.strftime("%Y%m%d%H%M%S")
    else
      "%.3d" % (current_migration_number(dirname) + 1)
    end
  end

  def create_migration_file
    migration_template 'migration.rb', 'db/migrate/create_globalize_translations.rb'
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
exvo_globalize-0.3.2 lib/generators/exvo_globalize/exvo_globalize_generator.rb
exvo_globalize-0.3.1 lib/generators/exvo_globalize/exvo_globalize_generator.rb
exvo_globalize-0.3.0 lib/generators/exvo_globalize/exvo_globalize_generator.rb
exvo_globalize-0.2.1 lib/generators/exvo_globalize/exvo_globalize_generator.rb
exvo_globalize-0.2.0 lib/generators/exvo_globalize/exvo_globalize_generator.rb
exvo_globalize-0.1.0 lib/generators/exvo_globalize/exvo_globalize_generator.rb
exvo_globalize-0.0.2 lib/generators/exvo_globalize/exvo_globalize_generator.rb