Sha256: f106472deaf9418c8835cc32935728f3aab7ab1c122f2bd351f071e193d349ca

Contents?: true

Size: 526 Bytes

Versions: 21

Compression:

Stored size: 526 Bytes

Contents

require "rails/generators/active_record"

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

      def copy_migration
        migration_template "space_stats.rb", "db/migrate/create_pghero_space_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/space_stats_generator.rb