One image for multiple categories

It does not. Images are stored by a hash, so only a single copy will be created/stored no matter how many times it’s uploaded.

If you have access to rails you can do something like this:

parent=Category.find_by_slug('category_a');
children=Category.where(parent_category_id: parent.id);
children.update_all(uploaded_logo_id: parent.uploaded_logo_id);

The trailing semicolons keep rails from putting the output in a viewer, so you can paste all three lines at once. You might omit them when you try this out. You should make a backup and be willing to restore it if you’re not trying this first on some kind of test or staging site.

You can suggest that your overloards read It’s Time We Talked About Tags. Or maybe there is some good reason for all of the subcategories. Unless you need to limit access to those subcategories or people will want to watch/mute those categories, they are probably doing to make things worse for everyone (except the person who gets bragging rights that their bad idea was the one that was accepted by the Whole Company).

1 Like