Sha256: 5685043683d1d921da586b8ebe41957b1e84e090caa96cbab79371835c226d46

Contents?: true

Size: 749 Bytes

Versions: 1

Compression:

Stored size: 749 Bytes

Contents

module ActiveGraph
  module Generators
    class UpgradeV8Generator < ::Rails::Generators::Base
      include ::ActiveGraph::Generators::SourcePathHelper
      include ::ActiveGraph::Generators::MigrationHelper

      def create_upgrade_v8_file
        @schema = load_all_models_schema!
        migration_template 'migration.erb'
      end

      def file_name
        'upgrate_to_v8'
      end

      private

      def load_all_models_schema!
        Rails.application.eager_load!
        initialize_all_models!
        ActiveGraph::ModelSchema.legacy_model_schema_informations
      end

      def initialize_all_models!
        models = ActiveGraph::Node.loaded_classes
        models.map(&:ensure_id_property_info!)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activegraph-11.5.0.alpha.1 lib/active_graph/generators/upgrade_v8_generator.rb