Method: SolidusVirtualGiftCard::Spree::LineItemDecorator.prepended

Defined in:
app/decorators/models/solidus_virtual_gift_card/spree/line_item_decorator.rb

.prepended(base) ⇒ Object



4
5
6
7
8
9
10
11
# File 'app/decorators/models/solidus_virtual_gift_card/spree/line_item_decorator.rb', line 4

def self.prepended(base)
  base.class_eval do
    has_many :gift_cards, class_name: 'Spree::VirtualGiftCard', dependent: :destroy
    delegate :gift_card?, :gift_card, to: :product

    self.whitelisted_ransackable_associations += %w[order]
  end
end