summaryrefslogtreecommitdiff
path: root/app/models/bazaar_order.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/bazaar_order.rb')
-rw-r--r--app/models/bazaar_order.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/bazaar_order.rb b/app/models/bazaar_order.rb
new file mode 100644
index 0000000..d36d520
--- /dev/null
+++ b/app/models/bazaar_order.rb
@@ -0,0 +1,12 @@
+class BazaarOrder < ApplicationRecord
+ include DestroyIfZeroQuantity
+
+ belongs_to :character
+ belongs_to :item
+
+ validates :price_each, :quantity,
+ numericality: { greater_than_or_equal_to: 0,
+ less_than_or_equal_to: 2_000_000_000, only_integer: true }
+ validates :buy_order, inclusion: { in: [true, false] }
+
+end