Let's imagine a User
model with a has many posts relationship. It has an associated scope to ensure we only get relevant posts (i.e., posts not yet deleted).
class User
has_many :posts, -> { not_deleted }, inverse_of :user
end
class Post
belongs_to :user, inverse_of: :posts