Sha256: 5fbc019cd22e3ccb3d53c993b18e738c885d9c592949fc4fec6a703f0a1bec33

Contents?: true

Size: 517 Bytes

Versions: 2

Compression:

Stored size: 517 Bytes

Contents

require "rails/generators/active_record"

module AhoyEmail
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include ActiveRecord::Generators::Migration
      source_root File.join(__dir__, "templates")

      def copy_migration
        migration_template "install.rb", "db/migrate/create_ahoy_messages.rb", migration_version: migration_version
      end

      def migration_version
        "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ahoy_email-1.1.1 lib/generators/ahoy_email/install_generator.rb
ahoy_email-1.1.0 lib/generators/ahoy_email/install_generator.rb