delegates - Unscoped delegation in Rails -


class donateditem     belongs_to :donation_item      delegate :name, to: :donation_item, prefix: true end 

i'm using destroyed_at gem donationitem , i'm running error when call donated_item.donation_item_name on destroyed donationitem.

what's way make unscoped delegate call destroyed donationitem?

i ended using unscoped_associations gem , updated donateditem model.

class donateditem     belongs_to: :donation_item, unscoped: true      delegate :name, to: :donation_item, prefix: true end 

Popular posts from this blog