module PgHaMigrations::AllowedVersions

Constants

ALLOWED_VERSIONS

Public Instance Methods

inherited(subclass) click to toggle source
Calls superclass method
# File lib/pg_ha_migrations/allowed_versions.rb, line 12
def inherited(subclass)
  super
  unless ALLOWED_VERSIONS.include?(subclass.superclass)
    raise StandardError, "#{subclass.superclass} is not a permitted migration class\n" \
      "\n" \
      "To add a new version update the ALLOWED_VERSIONS constant in #{__FILE__}\n" \
      "Currently allowed versions: #{ALLOWED_VERSIONS.map { |v| "ActiveRecord::Migration[#{v.current_version}]" }.join(', ')}"
  end
end