Module: Gitlab::Database::RenameReservedPathsMigration::V1::MigrationClasses::Routable
- Defined in:
- lib/gitlab/database/rename_reserved_paths_migration/v1/migration_classes.rb
Instance Method Summary collapse
Instance Method Details
#build_full_path ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/gitlab/database/rename_reserved_paths_migration/v1/migration_classes.rb', line 19 def build_full_path if parent && path parent.full_path + '/' + path else path end end |
#full_path ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/gitlab/database/rename_reserved_paths_migration/v1/migration_classes.rb', line 9 def full_path if route && route.path.present? @full_path ||= route.path # rubocop:disable Gitlab/ModuleWithInstanceVariables else update_route if persisted? build_full_path end end |
#prepare_route ⇒ Object
32 33 34 35 36 |
# File 'lib/gitlab/database/rename_reserved_paths_migration/v1/migration_classes.rb', line 32 def prepare_route route || build_route(source: self) route.path = build_full_path @full_path = nil # rubocop:disable Gitlab/ModuleWithInstanceVariables end |
#update_route ⇒ Object
27 28 29 30 |
# File 'lib/gitlab/database/rename_reserved_paths_migration/v1/migration_classes.rb', line 27 def update_route prepare_route route.save end |