Sha256: acbc1624ecc5a3ff703a312381956c6b7b50603c3168f7cc00cbf7278f202c6a

Contents?: true

Size: 676 Bytes

Versions: 3

Compression:

Stored size: 676 Bytes

Contents

require "rails/generators"

module StrongMigrations
  module Generators
    class InstallGenerator < Rails::Generators::Base
      source_root File.join(__dir__, "templates")

      def create_initializer
        template "initializer.rb", "config/initializers/strong_migrations.rb"
      end

      def start_after
        Time.now.utc.strftime("%Y%m%d%H%M%S")
      end

      def target_version
        case ActiveRecord::Base.connection_config[:adapter].to_s
        when /mysql/
          # could try to connect to database and check for MariaDB
          # but this should be fine
          '"8.0.12"'
        else
          "10"
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
strong_migrations-0.7.3 lib/generators/strong_migrations/install_generator.rb
strong_migrations-0.7.2 lib/generators/strong_migrations/install_generator.rb
strong_migrations-0.7.1 lib/generators/strong_migrations/install_generator.rb