Skip to content
Snippets Groups Projects

Cleanup leftovers in packages_dependencies table

Compare and
8 files
+ 137
0
Compare changes
  • Side-by-side
  • Inline
Files
8
@@ -41,6 +41,11 @@ def self.pluck_ids_and_names
pluck(:id, :name)
end
def self.orphaned
subquery = Packages::DependencyLink.where(Packages::DependencyLink.arel_table[:dependency_id].eq(Packages::Dependency.arel_table[:id]))
where_not_exists(subquery)
end
def orphaned?
self.dependency_links.empty?
end
Loading