-
I want to delete resources that were ingested as duplicates. Since there are too many I want to use the Rails console to search for the duplicates and remove them all. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
So, there isn't a public interface (eg, a rake task) for doing this. To make a change like this, you need to use the rails console to interact with the model layer directly. Generally speaking, this shouldn't be done, as there are lots of ways to get your instances data into an invalid state this way. Bottom line: what I'm about to explain is for experts only and is not an official, supported way to manage content in Manifold. With a package install, you access the rails console with To get a specific project, you would run this command (but replace the fake ID with the actual ID):
From there, you can access the project's resources and manipulate them. For example, to see the count of resources:
To destroy all of the resources that belong to that project, you'd use the following command:
That destroy_all command can take a little while if there are hundreds of associations. Please make sure you've backed up your instance before you mess around in the Rails console. Better safe than sorry! |
Beta Was this translation helpful? Give feedback.
So, there isn't a public interface (eg, a rake task) for doing this. To make a change like this, you need to use the rails console to interact with the model layer directly. Generally speaking, this shouldn't be done, as there are lots of ways to get your instances data into an invalid state this way. Bottom line: what I'm about to explain is for experts only and is not an official, supported way to manage content in Manifold.
With a package install, you access the rails console with
manifold-api console
from the command line. In the console, you're writing Ruby commands that interact directly with the application, so be careful. Knowledge of Ruby and Rails is going to be helpful here.To…