Commit 0088548f authored by Ash McKenzie's avatar Ash McKenzie

Use local generator templates for Geo DB migrations

parent 9554796e
...@@ -2,12 +2,8 @@ require 'rails/generators' ...@@ -2,12 +2,8 @@ require 'rails/generators'
require 'rails/generators/active_record' require 'rails/generators/active_record'
require 'rails/generators/active_record/migration/migration_generator' 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 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 def create_migration_file
set_local_assigns! 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