Skip to content
Snippets Groups Projects
Commit f6357b77 authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Allow to use the latest migration in migration specs


This is useful for migration tests that relies on factories and that are
very old and/or tedious to modify to not use factories.

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 5912d9b7
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -45,7 +45,13 @@ module MigrationsHelpers
end
 
def migration_schema_version
self.class.metadata[:schema] || previous_migration.version
metadata_schema = self.class.metadata[:schema]
if metadata_schema == :latest
migrations.last.version
else
metadata_schema || previous_migration.version
end
end
 
def schema_migrate_down!
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment