menu, table,rooms, orders structure
This commit is contained in:
10
app/models/order_item.rb
Normal file
10
app/models/order_item.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class OrderItem < ApplicationRecord
|
||||
#Associations
|
||||
belongs_to :order
|
||||
|
||||
#Validation
|
||||
validates_presence_of :item_code, :item_name, :qty
|
||||
validates :qty, numericality: { :greater_than 0 }
|
||||
validates_associated :orders
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user