Merge branch 'adminbsb_ui_changes' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -7,4 +7,7 @@ class Commissioner < ApplicationRecord
|
||||
|
||||
# validations
|
||||
validates_presence_of :name
|
||||
|
||||
# Commissioner Image Uploader
|
||||
mount_uploader :image_path, CommissionerImageUploader
|
||||
end
|
||||
|
||||
@@ -2,6 +2,9 @@ class Customer < ApplicationRecord
|
||||
|
||||
#self.primary_key = :customer_id
|
||||
|
||||
# Customer Image Uploader
|
||||
mount_uploader :image_path, CustomerImageUploader
|
||||
|
||||
before_create :generate_custom_id
|
||||
has_many :orders
|
||||
has_many :sales
|
||||
|
||||
5
app/models/display_image.rb
Normal file
5
app/models/display_image.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class DisplayImage < ApplicationRecord
|
||||
mount_uploader :image, DisplayImageUploader
|
||||
belongs_to :shop
|
||||
|
||||
end
|
||||
@@ -8,6 +8,9 @@ class Employee < ApplicationRecord
|
||||
validates :emp_id, uniqueness: true, numericality: true, length: {in: 1..4}, allow_blank: true
|
||||
validates :password, numericality: true, length: {in: 3..9}, allow_blank: true
|
||||
|
||||
# Employee Image Uploader
|
||||
mount_uploader :image_path, EmployeeImageUploader
|
||||
|
||||
def self.all_emp_except_waiter
|
||||
Employee.where('role!=?','waiter')
|
||||
end
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
class Shop < ApplicationRecord
|
||||
ShopDetail = Shop.find_by_id(1)
|
||||
|
||||
# Shop Image Uploader
|
||||
mount_uploader :logo, ShopImageUploader
|
||||
|
||||
has_many :display_images
|
||||
accepts_nested_attributes_for :display_images
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user