Sha256: 75bf89cfdc315aa061f73e32d047b1a0eb057958fd45963b0d0bdf7900b42909

Contents?: true

Size: 1.21 KB

Versions: 12

Compression:

Stored size: 1.21 KB

Contents

module Glueby
  module Contract
    class TokenGenerator < Rails::Generators::Base
      include ::Rails::Generators::Migration
      include Glueby::Generator::MigrateGenerator
      extend Glueby::Generator::MigrateGenerator::ClassMethod

      source_root File.expand_path('templates', __dir__)

      def create_migration_file
        migration_dir = File.expand_path("db/migrate")

        if self.class.migration_exists?(migration_dir, "create_token_metadata")
          ::Kernel.warn "Migration already exists: create_token_metadata"
        else
          migration_template(
            "token_metadata_table.rb.erb",
            "db/migrate/create_token_metadata.rb",
            migration_version: migration_version,
            table_options: table_options,
          )
        end

        if self.class.migration_exists?(migration_dir, "create_reissuable_token")
          ::Kernel.warn "Migration already exists: create_reissuable_token"
        else
          migration_template(
            "reissuable_token_table.rb.erb",
            "db/migrate/create_reissuable_token.rb",
            migration_version: migration_version,
            table_options: table_options,
          )
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
glueby-1.4.0 lib/generators/glueby/contract/token_generator.rb
glueby-1.3.0 lib/generators/glueby/contract/token_generator.rb
glueby-1.2.3 lib/generators/glueby/contract/token_generator.rb
glueby-1.2.2 lib/generators/glueby/contract/token_generator.rb
glueby-1.2.1 lib/generators/glueby/contract/token_generator.rb
glueby-1.2.0 lib/generators/glueby/contract/token_generator.rb
glueby-1.2.0.beta.3 lib/generators/glueby/contract/token_generator.rb
glueby-1.2.0.beta.2 lib/generators/glueby/contract/token_generator.rb
glueby-1.2.0.beta.1 lib/generators/glueby/contract/token_generator.rb
glueby-1.1.2 lib/generators/glueby/contract/token_generator.rb
glueby-1.1.1 lib/generators/glueby/contract/token_generator.rb
glueby-1.1.0 lib/generators/glueby/contract/token_generator.rb