Sha256: c80611f1f2a65abd15babaa8ba2ce9de5631aa0a1cd93dd0894b79a87de57475

Contents?: true

Size: 526 Bytes

Versions: 21

Compression:

Stored size: 526 Bytes

Contents

require "rails/generators/active_record"

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

      def copy_migration
        migration_template "query_stats.rb", "db/migrate/create_pghero_query_stats.rb", migration_version: migration_version
      end

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

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
pghero-2.3.0 lib/generators/pghero/query_stats_generator.rb