Sha256: 8f9f34cae0c16e2722f5e53c2e6c5bd93a045f008c003bf4a8591b069c1039ef

Contents?: true

Size: 553 Bytes

Versions: 9

Compression:

Stored size: 553 Bytes

Contents

require "rails/generators"
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

9 entries across 9 versions & 1 rubygems

Version Path
pghero-3.6.1 lib/generators/pghero/query_stats_generator.rb
pghero-3.6.0 lib/generators/pghero/query_stats_generator.rb
pghero-3.4.1 lib/generators/pghero/query_stats_generator.rb
pghero-3.4.0 lib/generators/pghero/query_stats_generator.rb
pghero-3.3.4 lib/generators/pghero/query_stats_generator.rb
pghero-3.3.3 lib/generators/pghero/query_stats_generator.rb
pghero-3.3.2 lib/generators/pghero/query_stats_generator.rb
pghero-3.3.1 lib/generators/pghero/query_stats_generator.rb
pghero-3.3.0 lib/generators/pghero/query_stats_generator.rb