Overrides the init_on_load method so that it will check if any migration is needed. The #init_on_create method is also overridden so that it sets the version to the latest migration number when a new node is created.
Migration will take place if needed when the node is loaded.
# File lib/neo4j/migrations/lazy_node_mixin.rb, line 44 def db_version self[:_db_version] end
# File lib/neo4j/migrations/lazy_node_mixin.rb, line 31 def init_on_create(*) super # set the db version to the current self[:_db_version] = self.class.migrate_to end
# File lib/neo4j/migrations/lazy_node_mixin.rb, line 27 def migrate! self.class._migrate!(self._java_node, self) end