Class: Uomi::Buyer

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/uomi/buyer.rb

Class Method Summary collapse

Class Method Details

.for(buyerable) ⇒ Object



6
7
8
# File 'lib/uomi/buyer.rb', line 6

def self.for(buyerable)
  Buyer.where(buyerable_type: buyerable.class.name, buyerable_id: buyerable.id).first || Buyer.create!(buyerable_type: buyerable.class.name, buyerable_id: buyerable.id)
end