class Spree::Bid < Spree::Base belongs_to :auction, class_name: 'Spree::Auction' belongs_to :bidder, class_name: 'Spree::User' validates :auction_id, presence: true validates :bidder_id, presence: true validates :amount, presence: true extend Spree::DisplayMoney money_methods :amount def is_autobid? !visible && accepted end def bidder_display_name bidder.email end end