lib/para/components_cleaner.rb in para-0.9.3.3 vs lib/para/components_cleaner.rb in para-0.9.4
- old
+ new
@@ -1,18 +1,22 @@
+# frozen_string_literal: true
+
module Para
class ComponentsCleaner
# Hide class instanciation
- def self.run; new.run; end
+ def self.run
+ new.run
+ end
def run
components.each do |component|
- unless component == Para.components.component_for(component.identifier)
+ if component.id != Para.components.components_ids_hash[component.identifier]
component.destroy
end
end
Para::ComponentSection.find_each do |section|
- unless Para.components.section_for(section.identifier)
+ unless Para.components.sections_ids_hash[section.identifier]
section.destroy
end
end
end