update qr code system and add location setter for suppliers
This commit is contained in:
@@ -6,6 +6,8 @@ class Supplier
|
||||
property :name
|
||||
property :open, type: :boolean, default: false
|
||||
property :night_offset, type: Float
|
||||
property :lat, type: Float, default: 52.08062426379751
|
||||
property :lng, type: Float, default: 4.312562942504883
|
||||
|
||||
#WIFI
|
||||
property :offer_wifi
|
||||
@@ -24,6 +26,16 @@ class Supplier
|
||||
|
||||
after_create :add_section_on_create
|
||||
|
||||
def location=(val)
|
||||
lat, lng = val.strip.split(/[ ,]+/).map(&:to_f)
|
||||
self.lat = lat
|
||||
self.lng = lng
|
||||
end
|
||||
|
||||
def location
|
||||
[lat, lng].join(',')
|
||||
end
|
||||
|
||||
def active_orders(options = {})
|
||||
return @active_orders if @active_orders && @active_orders_options == options
|
||||
@active_orders_options = options
|
||||
|
||||
Reference in New Issue
Block a user