update qr code system and add location setter for suppliers

This commit is contained in:
2012-11-19 19:09:23 +01:00
parent 0036e5da60
commit 633665daaa
13 changed files with 369 additions and 350 deletions
+12
View File
@@ -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