rubysherpas / paranoia

acts_as_paranoid for Rails 5, 6 and 7
Other
2.89k stars 529 forks source link

Unable to display associated records #486

Open jadamdipak opened 4 years ago

jadamdipak commented 4 years ago

Anybody can help me, how we get associate records with_deleted scope

haydenrou commented 4 years ago

Hi @jadamdipak , apologies if I'm missing your point here, but you should be able to access the deleted associations per the below:

When creating the association: class User < ActiveRecord::Base; has_many :notifications, -> { with_deleted }; end

or explicitly User.find(params[:id]).notifications.with_deleted