Created
May 10, 2023 13:47
-
-
Save nathancolgate/ae79d63d976b5e2beefe41261cc749cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sheriff = Proprietor.find_by(name: "Sheriff") | |
Building.where(proprietor: sheriff).each do |building| | |
building.photo.purge | |
building.attachments.each do |attachment| | |
attachment.file.purge | |
end | |
building.floor_plans.each do |floor_plan| | |
floor_plan.blueprint.purge | |
end | |
building.building_systems.each do |system| | |
system.attachments.each do |attachment| | |
attachment.file.purge | |
end | |
end | |
building.deficiencies.each do |deficiency| | |
deficiency.attachments.each do |attachment| | |
attachment.file.purge | |
end | |
end | |
building.devices.each do |device| | |
device.attachments.each do |attachment| | |
attachment.file.purge | |
end | |
end | |
building.distress_samples.each do |sample| | |
sample.attachments.each do |attachment| | |
attachment.file.purge | |
end | |
end | |
building.report_archives.each do |archive| | |
archive.archived_reports.each do |report| | |
report.attachment.purge | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment