Sha256: 2b8cdb969ccd58fd4a5769b843dc832febfc4d8aee2c563a5a222fc2da20ece4

Contents?: true

Size: 804 Bytes

Versions: 90

Compression:

Stored size: 804 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', '..', '..', '..', 'neo4j.rb')

module Neo4j
  module Generators
    class UpgradeV8Generator < ::Rails::Generators::Base
      include ::Neo4j::Generators::SourcePathHelper
      include ::Neo4j::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!
        Neo4j::ModelSchema.legacy_model_schema_informations
      end

      def initialize_all_models!
        models = Neo4j::ActiveNode.loaded_classes
        models.map(&:ensure_id_property_info!)
      end
    end
  end
end

Version data entries

90 entries across 90 versions & 2 rubygems

Version Path
neo4j-9.6.2 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
activegraph-10.0.0.pre.alpha.11 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
activegraph-10.0.0.pre.alpha.10 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
activegraph-10.0.0.pre.alpha.9 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
activegraph-10.0.0.pre.alpha.8 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
activegraph-10.0.0.pre.alpha.7 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
activegraph-10.0.0.pre.alpha.6 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
neo4j-10.0.0.pre.alpha.5 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
neo4j-10.0.0.pre.alpha.4 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
neo4j-10.0.0.pre.alpha.3 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
neo4j-10.0.0.pre.alpha.2 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
neo4j-10.0.0.pre.alpha.1 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
neo4j-9.6.1 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
neo4j-9.6.0 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
neo4j-9.5.3 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
neo4j-9.5.2 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
neo4j-9.5.0 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
neo4j-9.4.0 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
neo4j-9.3.0 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb
neo4j-9.2.4 lib/rails/generators/neo4j/upgrade_v8/upgrade_v8_generator.rb