From 38645382448a90e8fd56a7342732bef939f0d972 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Thu, 21 Apr 2022 13:16:30 +0200 Subject: [PATCH] AH bids --- src/lib/db_init.rb | 1 + src/lib/db_models.rb | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/lib/db_init.rb b/src/lib/db_init.rb index a5c6a3c..84f8e07 100644 --- a/src/lib/db_init.rb +++ b/src/lib/db_init.rb @@ -5,6 +5,7 @@ LOAD_MODELS = [ Role, User_Role_relation, Auction, + Bid, Auction_Category_relation, Category, Image diff --git a/src/lib/db_models.rb b/src/lib/db_models.rb index 0094211..2a15a66 100644 --- a/src/lib/db_models.rb +++ b/src/lib/db_models.rb @@ -352,6 +352,16 @@ class Auction < EntityModel end end +# Auction bids +class Bid < EntityModel + attr_reader :amount, :auction_id, :user_id, :message + def initialize(data) + super data + @amount = data["amount"].to_f + # stuff + end +end + class Category < EntityModel attr_reader :name, :color