Closed adaam2 closed 5 years ago
Why did you close this issue? Did you find a solution?
Otherwise they will be dumped while traversing associations from one of the specified root
s unless you will forbid them with exclude
. E.g. if you have “users has many posts has many likes belongs to likers” and you want recent posts with authors and likes but without liked users you can do something like this:
config.root("Post", 'created_at > ?', 1.week.ago) do |root|
root.exclude('likes.liker')
end
First of all, thanks for your wonderful work. This gem is 100000x better than our custom dump script.
Your docs mention the
exclude
method for excluding associations of a model, but there are a few tables where I would like to exclude all data from the dump. I tried to add a constraint ofcreated_at > Time.now
to exclude in slightly naive way, but of course by the time the dump of the tables occurredTime.now
had passed.Apologies if I have accidentally skimmed over how to do this in your documentation