Commit 0badc71a authored by Sean McGivern's avatar Sean McGivern

Merge branch '7074-rails5-make-geomigrationgenerator-compatible-with-rails-5' into 'master'

Resolve "[Rails5] Make GeoMigrationGenerator compatible with Rails 5"

Closes #7074

See merge request gitlab-org/gitlab-ee!7219
parents 9554796e 0088548f
......@@ -2,12 +2,8 @@ require 'rails/generators'
require 'rails/generators/active_record'
require 'rails/generators/active_record/migration/migration_generator'
# TODO: this can be removed once we verify that this works as intended if we're
# on Rails 5 since we use private Rails APIs.
raise "Vendored ActiveRecord 5 code! Delete #{__FILE__}!" if ActiveRecord::VERSION::MAJOR >= 5
class GeoMigrationGenerator < ActiveRecord::Generators::MigrationGenerator
source_root File.join(File.dirname(ActiveRecord::Generators::MigrationGenerator.instance_method(:create_migration_file).source_location.first), 'templates')
source_root File.join(Rails.root, 'generator_templates/active_record/migration')
def create_migration_file
set_local_assigns!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment