add CarrierWave gems for menu image upload

This commit is contained in:
Yan
2017-08-14 18:53:39 +06:30
parent ac47d7d8f0
commit f018a56027
8 changed files with 50 additions and 23 deletions

View File

@@ -15,6 +15,9 @@ class MenuItem < ApplicationRecord
scope :simple_menu_item, -> { where(type: 'SimpleMenuItem') }
scope :set_menu_item, -> { where(type: 'SetMenuItem') }
# Item Image Uploader
mount_uploader :image_path, MenuItemImageUploader
def self.collection
MenuItem.select("id, name").map { |e| [e.name, e.id] }
end