I’m using acts_as_votable This gem is really useful. But one thing that I want.
That’s dependency.
When user is deleted, related votes records also should be deleted.
However, this gem didn’t create the model called “models/vote.rb”
So I cannot write this
user.rb
has_many :votes, :dependent => :destroy
If possible I also want to add deleted_at attribute to this model so that I can use logical deletion.
How can I solve this while I’m using this gem?
Easy way:
Fork the gem.
Apply your patch.
Point your Gemfile to your own repository.
Bonus: Offer a pull-request of your code to the owner.
Stupid way:
Look into acts_as_votable and check what the method applies to your model.
Swap the two in your model and correct the association to include dependent: :destroy