rename qwaiter to mozo

This commit is contained in:
2025-09-20 17:35:58 -05:00
parent 7212d9041e
commit 0e051b1f93
99 changed files with 189 additions and 168 deletions
+1 -1
View File
@@ -4,4 +4,4 @@
require File.expand_path('../config/application', __FILE__) require File.expand_path('../config/application', __FILE__)
Qwaiter::Application.load_tasks Mozo::Application.load_tasks

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

+3 -3
View File
@@ -197,7 +197,7 @@
style="font-size:4.56339216px;fill:#634227;font-family:HelveticaRounded-Bold" style="font-size:4.56339216px;fill:#634227;font-family:HelveticaRounded-Bold"
x="8.5248251" x="8.5248251"
y="30.760637" y="30.760637"
inkscape:export-filename="/Users/bterkuile/Qwaiter/Android app/Pictures/icon-high-res.png" inkscape:export-filename="/Users/bterkuile/Mozo/Android app/Pictures/icon-high-res.png"
inkscape:export-xdpi="766.79059" inkscape:export-xdpi="766.79059"
inkscape:export-ydpi="766.79059"><tspan inkscape:export-ydpi="766.79059"><tspan
style="font-family:Arial Rounded MT Bold;-inkscape-font-specification:Arial Rounded MT Bold" style="font-family:Arial Rounded MT Bold;-inkscape-font-specification:Arial Rounded MT Bold"
@@ -207,7 +207,7 @@
x="12.23935" x="12.23935"
y="30.760637" y="30.760637"
style="font-size:5.810462px" style="font-size:5.810462px"
inkscape:export-filename="/Users/bterkuile/Qwaiter/Android app/Pictures/icon-high-res.png" inkscape:export-filename="/Users/bterkuile/Mozo/Android app/Pictures/icon-high-res.png"
inkscape:export-xdpi="766.79059" inkscape:export-xdpi="766.79059"
inkscape:export-ydpi="766.79059"><tspan inkscape:export-ydpi="766.79059"><tspan
x="12.23935" x="12.23935"
@@ -221,7 +221,7 @@
style="font-size:4.56339216px;fill:#634227;font-family:HelveticaRounded-Bold" style="font-size:4.56339216px;fill:#634227;font-family:HelveticaRounded-Bold"
x="26.997444" x="26.997444"
y="30.760637" y="30.760637"
inkscape:export-filename="/Users/bterkuile/Qwaiter/Android app/Pictures/icon-high-res.png" inkscape:export-filename="/Users/bterkuile/Mozo/Android app/Pictures/icon-high-res.png"
inkscape:export-xdpi="766.79059" inkscape:export-xdpi="766.79059"
inkscape:export-ydpi="766.79059"><tspan inkscape:export-ydpi="766.79059"><tspan
style="font-family:Arial Rounded MT Bold;-inkscape-font-specification:Arial Rounded MT Bold" style="font-family:Arial Rounded MT Bold;-inkscape-font-specification:Arial Rounded MT Bold"

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

+3 -3
View File
@@ -197,7 +197,7 @@
style="font-size:4.56339216px;fill:#634227;font-family:HelveticaRounded-Bold" style="font-size:4.56339216px;fill:#634227;font-family:HelveticaRounded-Bold"
x="8.5248251" x="8.5248251"
y="30.760637" y="30.760637"
inkscape:export-filename="/Users/bterkuile/Qwaiter/Android app/Pictures/icon-high-res.png" inkscape:export-filename="/Users/bterkuile/Mozo/Android app/Pictures/icon-high-res.png"
inkscape:export-xdpi="766.79059" inkscape:export-xdpi="766.79059"
inkscape:export-ydpi="766.79059"><tspan inkscape:export-ydpi="766.79059"><tspan
style="font-family:Arial Rounded MT Bold;-inkscape-font-specification:Arial Rounded MT Bold" style="font-family:Arial Rounded MT Bold;-inkscape-font-specification:Arial Rounded MT Bold"
@@ -207,7 +207,7 @@
x="12.23935" x="12.23935"
y="30.760637" y="30.760637"
style="font-size:5.810462px" style="font-size:5.810462px"
inkscape:export-filename="/Users/bterkuile/Qwaiter/Android app/Pictures/icon-high-res.png" inkscape:export-filename="/Users/bterkuile/Mozo/Android app/Pictures/icon-high-res.png"
inkscape:export-xdpi="766.79059" inkscape:export-xdpi="766.79059"
inkscape:export-ydpi="766.79059"><tspan inkscape:export-ydpi="766.79059"><tspan
x="12.23935" x="12.23935"
@@ -221,7 +221,7 @@
style="font-size:4.56339216px;fill:#634227;font-family:HelveticaRounded-Bold" style="font-size:4.56339216px;fill:#634227;font-family:HelveticaRounded-Bold"
x="26.997444" x="26.997444"
y="30.760637" y="30.760637"
inkscape:export-filename="/Users/bterkuile/Qwaiter/Android app/Pictures/icon-high-res.png" inkscape:export-filename="/Users/bterkuile/Mozo/Android app/Pictures/icon-high-res.png"
inkscape:export-xdpi="766.79059" inkscape:export-xdpi="766.79059"
inkscape:export-ydpi="766.79059"><tspan inkscape:export-ydpi="766.79059"><tspan
style="font-family:Arial Rounded MT Bold;-inkscape-font-specification:Arial Rounded MT Bold" style="font-family:Arial Rounded MT Bold;-inkscape-font-specification:Arial Rounded MT Bold"

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Before

Width:  |  Height:  |  Size: 236 KiB

After

Width:  |  Height:  |  Size: 236 KiB

Before

Width:  |  Height:  |  Size: 492 KiB

After

Width:  |  Height:  |  Size: 492 KiB

+6 -6
View File
@@ -218,7 +218,7 @@
style="font-size:4.56339216px;fill:#634227;font-family:HelveticaRounded-Bold" style="font-size:4.56339216px;fill:#634227;font-family:HelveticaRounded-Bold"
x="8.5248251" x="8.5248251"
y="30.760637" y="30.760637"
inkscape:export-filename="/Users/bterkuile/Qwaiter/Android app/Pictures/icon-high-res.png" inkscape:export-filename="/Users/bterkuile/Mozo/Android app/Pictures/icon-high-res.png"
inkscape:export-xdpi="766.79059" inkscape:export-xdpi="766.79059"
inkscape:export-ydpi="766.79059"><tspan inkscape:export-ydpi="766.79059"><tspan
style="font-family:Arial Rounded MT Bold;-inkscape-font-specification:Arial Rounded MT Bold" style="font-family:Arial Rounded MT Bold;-inkscape-font-specification:Arial Rounded MT Bold"
@@ -235,7 +235,7 @@
x="12.23935" x="12.23935"
y="30.760637" y="30.760637"
style="font-size:5.810462px" style="font-size:5.810462px"
inkscape:export-filename="/Users/bterkuile/Qwaiter/Android app/Pictures/icon-high-res.png" inkscape:export-filename="/Users/bterkuile/Mozo/Android app/Pictures/icon-high-res.png"
inkscape:export-xdpi="766.79059" inkscape:export-xdpi="766.79059"
inkscape:export-ydpi="766.79059"><tspan inkscape:export-ydpi="766.79059"><tspan
x="12.23935" x="12.23935"
@@ -256,7 +256,7 @@
style="font-size:4.56339216px;fill:#634227;font-family:HelveticaRounded-Bold" style="font-size:4.56339216px;fill:#634227;font-family:HelveticaRounded-Bold"
x="26.997444" x="26.997444"
y="30.760637" y="30.760637"
inkscape:export-filename="/Users/bterkuile/Qwaiter/Android app/Pictures/icon-high-res.png" inkscape:export-filename="/Users/bterkuile/Mozo/Android app/Pictures/icon-high-res.png"
inkscape:export-xdpi="766.79059" inkscape:export-xdpi="766.79059"
inkscape:export-ydpi="766.79059"><tspan inkscape:export-ydpi="766.79059"><tspan
style="font-family:Arial Rounded MT Bold;-inkscape-font-specification:Arial Rounded MT Bold" style="font-family:Arial Rounded MT Bold;-inkscape-font-specification:Arial Rounded MT Bold"
@@ -270,7 +270,7 @@
<g <g
id="g3012" id="g3012"
inkscape:export-filename="/Users/bterkuile/Qwaiter/Android app/Pictures/icon-high-res.png" inkscape:export-filename="/Users/bterkuile/Mozo/Android app/Pictures/icon-high-res.png"
inkscape:export-xdpi="766.79059" inkscape:export-xdpi="766.79059"
inkscape:export-ydpi="766.79059" inkscape:export-ydpi="766.79059"
transform="matrix(0.48420519,0,0,0.48420519,-3.826694,-4.5856657)"><path transform="matrix(0.48420519,0,0,0.48420519,-3.826694,-4.5856657)"><path
@@ -456,7 +456,7 @@
<g <g
id="g3013-3" id="g3013-3"
transform="matrix(0.48200257,0,0,0.48200257,26.923785,-2.880595)" transform="matrix(0.48200257,0,0,0.48200257,26.923785,-2.880595)"
inkscape:export-filename="/Users/bterkuile/companytools/development/rails/screwed-qwaiter/app/assets/images/logo-big.png" inkscape:export-filename="/Users/bterkuile/companytools/development/rails/screwed-mozo/app/assets/images/logo-big.png"
inkscape:export-xdpi="449.67291" inkscape:export-xdpi="449.67291"
inkscape:export-ydpi="449.67291"><text inkscape:export-ydpi="449.67291"><text
inkscape:export-ydpi="112.82128" inkscape:export-ydpi="112.82128"
@@ -485,7 +485,7 @@
</g><g </g><g
id="g3012-8" id="g3012-8"
transform="matrix(0.53641805,0,0,0.53641805,25.074809,-5.264638)" transform="matrix(0.53641805,0,0,0.53641805,25.074809,-5.264638)"
inkscape:export-filename="/Users/bterkuile/companytools/development/rails/screwed-qwaiter/app/assets/images/logo-big.png" inkscape:export-filename="/Users/bterkuile/companytools/development/rails/screwed-mozo/app/assets/images/logo-big.png"
inkscape:export-xdpi="449.67291" inkscape:export-xdpi="449.67291"
inkscape:export-ydpi="449.67291"><path inkscape:export-ydpi="449.67291"><path
inkscape:export-ydpi="112.82128" inkscape:export-ydpi="112.82128"

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

@@ -30,7 +30,7 @@
right: 10px right: 10px
top: 10px top: 10px
z-index: 20 z-index: 20
background-image: image-url("theme1/home_qwaiter_den_haag.png") background-image: image-url("theme1/home_mozo_den_haag.png")
background-repeat: no-repeat background-repeat: no-repeat
background-position: center top background-position: center top
#home-splash-footer #home-splash-footer
+2 -2
View File
@@ -59,11 +59,11 @@ private
#END CMTOOL #END CMTOOL
def broadcast_user(uid, event, data = {}) def broadcast_user(uid, event, data = {})
Qwaiter.broadcast_user uid, event, data Mozo.broadcast_user uid, event, data
end end
def broadcast_supplier(sid, event, data = {}) def broadcast_supplier(sid, event, data = {})
Qwaiter.broadcast_supplier sid, event, data Mozo.broadcast_supplier sid, event, data
end end
def set_locale def set_locale
+2 -2
View File
@@ -405,11 +405,11 @@ class List
end end
def supplier_orders_in_process_count def supplier_orders_in_process_count
Qwaiter::Counter.get(Supplier.orders_in_process_counter_key(supplier_id)) Mozo::Counter.get(Supplier.orders_in_process_counter_key(supplier_id))
end end
def supplier_orders_placed_count def supplier_orders_placed_count
Qwaiter::Counter.get(Supplier.orders_placed_counter_key(supplier_id)) Mozo::Counter.get(Supplier.orders_placed_counter_key(supplier_id))
end end
def has_active_orders? def has_active_orders?
+1 -1
View File
@@ -1,6 +1,6 @@
class Section class Section
include SimplyStored::Couch include SimplyStored::Couch
include Qwaiter::Distribution include Mozo::Distribution
include ActiveModel::SerializerSupport include ActiveModel::SerializerSupport
property :title property :title
+10 -10
View File
@@ -8,27 +8,27 @@ class Supplier
end end
def increment_orders_in_process_count! def increment_orders_in_process_count!
Qwaiter::Counter.incr orders_in_process_counter_key Mozo::Counter.incr orders_in_process_counter_key
end end
def increment_orders_placed_count! def increment_orders_placed_count!
Qwaiter::Counter.incr orders_placed_counter_key Mozo::Counter.incr orders_placed_counter_key
end end
def decrement_orders_in_process_count! def decrement_orders_in_process_count!
Qwaiter::Counter.decr orders_in_process_counter_key Mozo::Counter.decr orders_in_process_counter_key
end end
def decrement_orders_placed_count! def decrement_orders_placed_count!
Qwaiter::Counter.decr orders_placed_counter_key Mozo::Counter.decr orders_placed_counter_key
end end
def orders_in_process_count def orders_in_process_count
Qwaiter::Counter.get orders_in_process_counter_key Mozo::Counter.get orders_in_process_counter_key
end end
def orders_placed_count def orders_placed_count
Qwaiter::Counter.get orders_placed_counter_key Mozo::Counter.get orders_placed_counter_key
end end
@@ -56,9 +56,9 @@ class Supplier
def reset_counters! def reset_counters!
# Set all known counters to zero # Set all known counters to zero
Qwaiter::Couchbase.flush_counters! Mozo::Couchbase.flush_counters!
Qwaiter::Counter.connection.flush if Qwaiter::Counter.connection.respond_to?(:flush) Mozo::Counter.connection.flush if Mozo::Counter.connection.respond_to?(:flush)
spec = Order.by_supplier_id_and_state(reduce: true, group_level: 2) spec = Order.by_supplier_id_and_state(reduce: true, group_level: 2)
reset_order_counters_with_spec spec reset_order_counters_with_spec spec
@@ -81,8 +81,8 @@ class Supplier
Array.wrap(results['rows']).each do |result| Array.wrap(results['rows']).each do |result|
supplier_id, state = result['key'] supplier_id, state = result['key']
case state case state
when 'placed' then Qwaiter::Counter.set orders_placed_counter_key(supplier_id), result['value'] when 'placed' then Mozo::Counter.set orders_placed_counter_key(supplier_id), result['value']
when 'active' then Qwaiter::Counter.set orders_in_process_counter_key(supplier_id), result['value'] when 'active' then Mozo::Counter.set orders_in_process_counter_key(supplier_id), result['value']
end end
end end
end end
@@ -1,4 +1,4 @@
class Employees::EmployeeSerializer class Employees::EmployeeSerializer
include Qwaiter::EmployeeBaseSerializer include Mozo::EmployeeBaseSerializer
attributes :name, :email, :manager, :active, :color attributes :name, :email, :manager, :active, :color
end end
@@ -1,5 +1,5 @@
class Employees::EmployeeShiftSerializer class Employees::EmployeeShiftSerializer
include Qwaiter::EmployeeBaseSerializer include Mozo::EmployeeBaseSerializer
attributes :start_from, :end_on, :description, :full_day attributes :start_from, :end_on, :description, :full_day
has_one :supplier, serializer: Employees::SupplierSerializer has_one :supplier, serializer: Employees::SupplierSerializer
has_one :employee, serializer: Employees::EmployeeSerializer has_one :employee, serializer: Employees::EmployeeSerializer
@@ -1,5 +1,5 @@
class Employees::SupplierSerializer class Employees::SupplierSerializer
include Qwaiter::EmployeeBaseSerializer include Mozo::EmployeeBaseSerializer
attributes :open, :name, :lat, :lng, :time_zone, :address, :house_number, :house_number_addition, :postal_code, :city, :country, attributes :open, :name, :lat, :lng, :time_zone, :address, :house_number, :house_number_addition, :postal_code, :city, :country,
:facebook_promotion_url, :iens_profile, :week_starts_on_monday, :orders_in_process_count, :orders_placed_count :facebook_promotion_url, :iens_profile, :week_starts_on_monday, :orders_in_process_count, :orders_placed_count
end end
@@ -1,5 +1,5 @@
class Suppliers::EmployeeSerializer class Suppliers::EmployeeSerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
attributes :name, :email, :manager, :active, :color attributes :name, :email, :manager, :active, :color
has_many :suppliers, serializer: Suppliers::SupplierSerializer has_many :suppliers, serializer: Suppliers::SupplierSerializer
@@ -1,5 +1,5 @@
class Suppliers::EmployeeShiftSerializer class Suppliers::EmployeeShiftSerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
attributes :start_from, :end_on, :description, :full_day attributes :start_from, :end_on, :description, :full_day
has_one :supplier, serializer: Suppliers::SupplierSerializer has_one :supplier, serializer: Suppliers::SupplierSerializer
has_one :employee, serializer: Suppliers::EmployeeSerializer has_one :employee, serializer: Suppliers::EmployeeSerializer
@@ -1,5 +1,6 @@
class Suppliers::JoinRequestSerializer class Suppliers::JoinRequestSerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
has_one :user, serializer: Suppliers::SupplierSerializer has_one :user, serializer: Suppliers::SupplierSerializer
has_one :list, serializer: Suppliers::ListSerializer has_one :list, serializer: Suppliers::ListSerializer
end end
+1 -1
View File
@@ -1,5 +1,5 @@
class Suppliers::ListSerializer class Suppliers::ListSerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
attributes :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price, :closed_at attributes :state, :needs_help, :needs_payment, :user_requests_closing, :is_paid, :price, :closed_at
has_many :orders, serializer: Suppliers::OrderSerializer has_many :orders, serializer: Suppliers::OrderSerializer
@@ -1,5 +1,5 @@
class Suppliers::OrderSerializer class Suppliers::OrderSerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
attributes :state #, :list_id, :section_id, :table_id #, :price attributes :state #, :list_id, :section_id, :table_id #, :price
has_one :list, serializer: Suppliers::ListSerializer has_one :list, serializer: Suppliers::ListSerializer
+1 -1
View File
@@ -1,5 +1,5 @@
class Suppliers::PageSerializer class Suppliers::PageSerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
attributes :title, :body, :locale, :position attributes :title, :body, :locale, :position
attribute(:name) { object.name.to_s.sub /^suppliers-/, '' } attribute(:name) { object.name.to_s.sub /^suppliers-/, '' }
def id def id
@@ -1,5 +1,5 @@
class Suppliers::ProductCategorySerializer class Suppliers::ProductCategorySerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
attributes :name, :supplier_id, :active_on_sunday, :active_on_monday, :active_on_tuesday, :active_on_wednesday, attributes :name, :supplier_id, :active_on_sunday, :active_on_monday, :active_on_tuesday, :active_on_wednesday,
:active_on_thursday, :active_on_friday, :active_on_saturday, :full_day, :start_from, :end_on, :active_on_thursday, :active_on_friday, :active_on_saturday, :full_day, :start_from, :end_on,
:position :position
@@ -1,5 +1,5 @@
class Suppliers::ProductOrderSerializer class Suppliers::ProductOrderSerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
attributes :quantity, :price, :product_name, :product_variant attributes :quantity, :price, :product_name, :product_variant
has_one :order, serializer: Suppliers::OrderSerializer has_one :order, serializer: Suppliers::OrderSerializer
has_one :product, serializer: Suppliers::ProductSerializer has_one :product, serializer: Suppliers::ProductSerializer
@@ -1,5 +1,6 @@
class Suppliers::ProductSerializer class Suppliers::ProductSerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
attributes :name, :price, :description, :code, :position, :visible, :active attributes :name, :price, :description, :code, :position, :visible, :active
attribute :image do attribute :image do
if object.image.present? if object.image.present?
@@ -1,5 +1,5 @@
class Suppliers::ProductVariantSerializer class Suppliers::ProductVariantSerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
attributes :name attributes :name
has_one :product, serializer: Suppliers::ProductSerializer has_one :product, serializer: Suppliers::ProductSerializer
end end
@@ -1,5 +1,5 @@
class Suppliers::SectionAreaSerializer class Suppliers::SectionAreaSerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
attributes :title, :width, :height, :position_x, :position_y, :rounded, :color attributes :title, :width, :height, :position_x, :position_y, :rounded, :color
has_one :section, serializer: Suppliers::SectionSerializer has_one :section, serializer: Suppliers::SectionSerializer
end end
@@ -1,5 +1,5 @@
class Suppliers::SectionElementSerializer class Suppliers::SectionElementSerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
attributes :name, :box_width, :box_height, :dpm, :svg, :position_x, :position_y, :rotation attributes :name, :box_width, :box_height, :dpm, :svg, :position_x, :position_y, :rotation
has_one :section, serializer: Suppliers::SectionSerializer has_one :section, serializer: Suppliers::SectionSerializer
end end
@@ -1,5 +1,6 @@
class Suppliers::SectionSerializer class Suppliers::SectionSerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
attributes :title, :width, :height #, :path attributes :title, :width, :height #, :path
has_many :tables, serializer: Suppliers::TableSerializer has_many :tables, serializer: Suppliers::TableSerializer
has_many :section_areas, serializer: Suppliers::SectionAreaSerializer has_many :section_areas, serializer: Suppliers::SectionAreaSerializer
@@ -1,5 +1,5 @@
class Suppliers::SupplierSerializer class Suppliers::SupplierSerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
attributes :open, :name, :email, :lat, :lng, :time_zone, :address, :house_number, :house_number_addition, :postal_code, :city, :country, attributes :open, :name, :email, :lat, :lng, :time_zone, :address, :house_number, :house_number_addition, :postal_code, :city, :country,
:facebook_promotion_url, :iens_profile, :week_starts_on_monday, :orders_in_process_count, :orders_placed_count, :user_message :facebook_promotion_url, :iens_profile, :week_starts_on_monday, :orders_in_process_count, :orders_placed_count, :user_message
@@ -1,4 +1,4 @@
class Suppliers::SvgElementSerializer class Suppliers::SvgElementSerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
attributes :name, :box_width, :box_height, :dpm, :svg attributes :name, :box_width, :box_height, :dpm, :svg
end end
@@ -1,4 +1,4 @@
class Suppliers::TableSerializer class Suppliers::TableSerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
attributes :number, :width, :height, :position_x, :position_y, :section_id, :active#, :active_list_id attributes :number, :width, :height, :position_x, :position_y, :section_id, :active#, :active_list_id
end end
+1 -1
View File
@@ -1,5 +1,5 @@
class Suppliers::UserSerializer class Suppliers::UserSerializer
include Qwaiter::SupplierBaseSerializer include Mozo::SupplierBaseSerializer
attributes :email, :provider, :uid, :avatar, :number_of_lists_at_supplier attributes :email, :provider, :uid, :avatar, :number_of_lists_at_supplier
attribute(:name) { object.supplier_name } attribute(:name) { object.supplier_name }
end end
@@ -1,5 +1,6 @@
class Users::JoinRequestSerializer class Users::JoinRequestSerializer
include Qwaiter::UserBaseSerializer include Mozo::UserBaseSerializer
has_one :user, serializer: Users::UserSerializer has_one :user, serializer: Users::UserSerializer
has_one :list, serializer: Users::ListSerializer has_one :list, serializer: Users::ListSerializer
end end
+2 -1
View File
@@ -1,5 +1,6 @@
class Users::ListSerializer class Users::ListSerializer
include Qwaiter::UserBaseSerializer include Mozo::UserBaseSerializer
# user ids for facebook pictures # user ids for facebook pictures
#self.root = :list #self.root = :list
attributes :state, :needs_help, :needs_payment, :user_requests_closing, attributes :state, :needs_help, :needs_payment, :user_requests_closing,
+2 -1
View File
@@ -1,5 +1,6 @@
class Users::OrderSerializer class Users::OrderSerializer
include Qwaiter::UserBaseSerializer include Mozo::UserBaseSerializer
attributes :state #, :list_id, :section_id, :table_id #, :price attributes :state #, :list_id, :section_id, :table_id #, :price
has_many :product_orders, serializer: Users::ProductOrderSerializer has_many :product_orders, serializer: Users::ProductOrderSerializer
@@ -2,7 +2,8 @@ class Users::ProductCategorySerializer
FEATURED_NAMES = %w[ FEATURED_NAMES = %w[
featured featured
] ]
include Qwaiter::UserBaseSerializer include Mozo::UserBaseSerializer
attributes :name, :supplier_id, :active_on_sunday, :active_on_monday, :active_on_tuesday, :active_on_wednesday, attributes :name, :supplier_id, :active_on_sunday, :active_on_monday, :active_on_tuesday, :active_on_wednesday,
:active_on_thursday, :active_on_friday, :active_on_saturday, :full_day, :start_from, :end_on, :active_on_thursday, :active_on_friday, :active_on_saturday, :full_day, :start_from, :end_on,
:position :position
@@ -1,5 +1,6 @@
class Users::ProductOrderSerializer class Users::ProductOrderSerializer
include Qwaiter::UserBaseSerializer include Mozo::UserBaseSerializer
attributes :quantity, :price, :product_name, :product_variant attributes :quantity, :price, :product_name, :product_variant
# belongs_to :product #DO NOT USE THIS, THIS IS NOT NEEDED, already included in /tables/:id/supplier # belongs_to :product #DO NOT USE THIS, THIS IS NOT NEEDED, already included in /tables/:id/supplier
has_one :order, serializer: Users::OrderSerializer has_one :order, serializer: Users::OrderSerializer
+3 -1
View File
@@ -1,6 +1,8 @@
class Users::ProductSerializer class Users::ProductSerializer
include Qwaiter::UserBaseSerializer include Mozo::UserBaseSerializer
HOST = Rails.application.config.action_controller.asset_host.to_s HOST = Rails.application.config.action_controller.asset_host.to_s
attributes :name, :price, :description, :code, :position, :visible, :active attributes :name, :price, :description, :code, :position, :visible, :active
attribute :image do attribute :image do
if object.image.present? if object.image.present?
@@ -1,5 +1,6 @@
class Users::ProductVariantSerializer class Users::ProductVariantSerializer
include Qwaiter::UserBaseSerializer include Mozo::UserBaseSerializer
attributes :name attributes :name
has_one :product, serializer: Users::ProductSerializer has_one :product, serializer: Users::ProductSerializer
+2 -1
View File
@@ -1,5 +1,6 @@
class Users::SupplierSerializer class Users::SupplierSerializer
include Qwaiter::UserBaseSerializer include Mozo::UserBaseSerializer
attributes :open, :name, :orders_placed_count, :orders_in_process_count, :user_message attributes :open, :name, :orders_placed_count, :orders_in_process_count, :user_message
has_many :product_categories, serializer: Users::ProductCategorySerializer has_many :product_categories, serializer: Users::ProductCategorySerializer
related_link_for :product_categories related_link_for :product_categories
+2 -1
View File
@@ -1,5 +1,6 @@
class Users::TableSerializer class Users::TableSerializer
include Qwaiter::UserBaseSerializer include Mozo::UserBaseSerializer
attributes :number, :width, :height, :position_x, :position_y, :section_id, :occupied, :active #, :supplier_id #, :alist_id attributes :number, :width, :height, :position_x, :position_y, :section_id, :occupied, :active #, :supplier_id #, :alist_id
has_one :supplier, serializer: Users::SupplierSerializer has_one :supplier, serializer: Users::SupplierSerializer
+2 -1
View File
@@ -1,5 +1,6 @@
class Users::UserSerializer class Users::UserSerializer
include Qwaiter::UserBaseSerializer include Mozo::UserBaseSerializer
attributes :email, :provider, :uid, :avatar attributes :email, :provider, :uid, :avatar
attribute(:name){ object.friends_name } attribute(:name){ object.friends_name }
end end
@@ -1,5 +1,6 @@
class Waiter::ProductCategorySerializer class Waiter::ProductCategorySerializer
include Qwaiter::WaiterBaseSerializer include Mozo::WaiterBaseSerializer
attributes :name, :supplier_id, :active_on_sunday, :active_on_monday, :active_on_tuesday, :active_on_wednesday, attributes :name, :supplier_id, :active_on_sunday, :active_on_monday, :active_on_tuesday, :active_on_wednesday,
:active_on_thursday, :active_on_friday, :active_on_saturday, :full_day, :start_from, :end_on, :active_on_thursday, :active_on_friday, :active_on_saturday, :full_day, :start_from, :end_on,
:position :position
+2 -1
View File
@@ -1,5 +1,6 @@
class Waiter::ProductSerializer class Waiter::ProductSerializer
include Qwaiter::WaiterBaseSerializer include Mozo::WaiterBaseSerializer
attributes :name, :price, :description, :code, :position, :visible, :active attributes :name, :price, :description, :code, :position, :visible, :active
attribute :image do attribute :image do
if object.image.present? if object.image.present?
@@ -1,5 +1,6 @@
class Waiter::ProductVariantSerializer class Waiter::ProductVariantSerializer
include Qwaiter::WaiterBaseSerializer include Mozo::WaiterBaseSerializer
attributes :name attributes :name
has_one :product, serializer: Waiter::ProductSerializer has_one :product, serializer: Waiter::ProductSerializer
end end
+2 -1
View File
@@ -1,5 +1,6 @@
class Waiter::SectionSerializer class Waiter::SectionSerializer
include Qwaiter::WaiterBaseSerializer include Mozo::WaiterBaseSerializer
attributes :title, :width, :height attributes :title, :width, :height
has_many :tables, serializer: Waiter::TableSerializer has_many :tables, serializer: Waiter::TableSerializer
has_one :supplier, serializer: Waiter::SupplierSerializer has_one :supplier, serializer: Waiter::SupplierSerializer
@@ -1,5 +1,6 @@
class Waiter::SupplierSerializer class Waiter::SupplierSerializer
include Qwaiter::WaiterBaseSerializer include Mozo::WaiterBaseSerializer
attributes :open, :name, :lat, :lng, :time_zone, :address, :house_number, :house_number_addition, :postal_code, :city, :country, attributes :open, :name, :lat, :lng, :time_zone, :address, :house_number, :house_number_addition, :postal_code, :city, :country,
:facebook_promotion_url, :iens_profile, :week_starts_on_monday, :orders_in_process_count, :orders_placed_count :facebook_promotion_url, :iens_profile, :week_starts_on_monday, :orders_in_process_count, :orders_placed_count
end end
+2 -1
View File
@@ -1,4 +1,5 @@
class Waiter::TableSerializer class Waiter::TableSerializer
include Qwaiter::WaiterBaseSerializer include Mozo::WaiterBaseSerializer
attributes :number, :width, :height, :position_x, :position_y, :section_id, :needs_help, :active attributes :number, :width, :height, :position_x, :position_y, :section_id, :needs_help, :active
end end
+1 -1
View File
@@ -18,6 +18,6 @@
ul#cartoon ul#cartoon
- for i in 1..6 - for i in 1..6
li li
.cartoon-image= image_tag "cartoon/qwaiter-cartoon-#{i}.png" .cartoon-image= image_tag "cartoon/mozo-cartoon-#{i}.png"
.cartoon-text= cartoon_text[I18n.locale][i] .cartoon-text= cartoon_text[I18n.locale][i]
.clearing .clearing
+5 -5
View File
@@ -12,18 +12,18 @@ html lang="en"
= javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js" = javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js"
= stylesheet_link_tag "user/wood1/application", :media => "all" = stylesheet_link_tag "user/wood1/application", :media => "all"
link href="/favicon.ico" rel="shortcut icon" link href="/favicon.ico" rel="shortcut icon"
- if ENV['QWAITER_MOBILE_EXPORT'] == 'yes' - if ENV['MOZO_MOBILE_EXPORT'] == 'yes'
javascript: javascript:
var QMobile, Qwaiter, Quser; var QMobile, Mozo, Quser;
var data_host = 'http://data.mozo.bar'; var data_host = 'http://data.mozo.bar';
var event_host = '#{Qwaiter.event_host}'; var event_host = '#{Mozo.event_host}';
var $asset_paths = '##assets_path##'; var $asset_paths = '##assets_path##';
var Qstorage = localStorage; var Qstorage = localStorage;
- else - else
javascript: javascript:
var QMobile, Qwaiter, Quser; var QMobile, Mozo, Quser;
var data_host = 'http://data.mozo.bar'; var data_host = 'http://data.mozo.bar';
var event_host = '#{Qwaiter.event_host}'; var event_host = '#{Mozo.event_host}';
var $assets_path = '/assets/'; var $assets_path = '/assets/';
var Qstorage = localStorage; var Qstorage = localStorage;
#{user_dynamic_data_host} #{user_dynamic_data_host}
+6 -6
View File
@@ -9,9 +9,9 @@ html lang="en"
= stylesheet_link_tag "user/foundation/application" = stylesheet_link_tag "user/foundation/application"
- if Rails.env.user_app? - if Rails.env.user_app?
javascript: javascript:
var QMobile, Qwaiter, Quser; var QMobile, Mozo, Quser;
var $data_host = 'http://data.mozo.bar'; var $data_host = 'http://data.mozo.bar';
var $event_host = '#{Qwaiter.event_host}'; var $event_host = '#{Mozo.event_host}';
var $assets_path = './assets/'; var $assets_path = './assets/';
var $app_version = '#{app_version}'; var $app_version = '#{app_version}';
var $day_names = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"] var $day_names = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]
@@ -23,9 +23,9 @@ html lang="en"
var $log = function(params){$.post('http://log.mozo.bar/user_app', {log: params})}; var $log = function(params){$.post('http://log.mozo.bar/user_app', {log: params})};
- elsif Rails.env.production? - elsif Rails.env.production?
javascript: javascript:
var QMobile, Qwaiter, Quser; var QMobile, Mozo, Quser;
var $data_host = null; var $data_host = null;
var $event_host = '#{Qwaiter.event_host}'; var $event_host = '#{Mozo.event_host}';
var $assets_path = '/assets/'; var $assets_path = '/assets/';
var $app_version = '#{app_version}'; var $app_version = '#{app_version}';
var $day_names = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"] var $day_names = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]
@@ -38,9 +38,9 @@ html lang="en"
var $log = function(params){console.log('App log:'); console.log(params);console.log('=======================================')}; var $log = function(params){console.log('App log:'); console.log(params);console.log('=======================================')};
- else - else
javascript: javascript:
var QMobile, Qwaiter, Quser; var QMobile, Mozo, Quser;
var $data_host = null; var $data_host = null;
var $event_host = '#{Qwaiter.event_host}'; var $event_host = '#{Mozo.event_host}';
var $assets_path = '/assets/'; var $assets_path = '/assets/';
var $app_version = '#{app_version}'; var $app_version = '#{app_version}';
var $day_names = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"] var $day_names = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]
@@ -5,6 +5,6 @@ var supplier_object=<%= {id: current_supplier.id}.to_json.html_safe %>;
var employee_object=<%=raw current_employee.object_attributes.to_json %>; var employee_object=<%=raw current_employee.object_attributes.to_json %>;
var data_host = ''; var data_host = '';
var $asset_path = '/assets/'; var $asset_path = '/assets/';
var event_host = '<%= Qwaiter.event_host %>'; var event_host = '<%= Mozo.event_host %>';
//var datepicker_options = {dateFormat: 'yy-mm-dd', firstDay: <%= current_supplier.week_starts_on_monday? ? 1 : 0 %>}; //var datepicker_options = {dateFormat: 'yy-mm-dd', firstDay: <%= current_supplier.week_starts_on_monday? ? 1 : 0 %>};
</script> </script>
+3 -3
View File
@@ -14,9 +14,9 @@ Rails.application.routes.default_url_options = {format: 'html'} # append .html e
rails_assets_path = Rails.root.join('public', 'assets') rails_assets_path = Rails.root.join('public', 'assets')
android_root = '/Users/bterkuile/Documents/workspace/mozo/www' android_root = '/Users/bterkuile/Documents/workspace/mozo/www'
ios_root = '/Users/bterkuile/Documents/iOS/Qwaiter/www' ios_root = '/Users/bterkuile/Documents/iOS/Mozo/www'
# android_root_url = "file:///Users/bterkuile/Documents/workspace/Qwaiter/assets" # android_root_url = "file:///Users/bterkuile/Documents/workspace/Mozo/assets"
android_root_url = 'file:///android_asset' android_root_url = 'file:///android_asset'
# Cleanup and setup android structure # Cleanup and setup android structure
@@ -85,7 +85,7 @@ for action in uc.action_methods
File.open(File.join(ios_root, "#{action}.html"), 'w'){|f| f.puts ios_view} File.open(File.join(ios_root, "#{action}.html"), 'w'){|f| f.puts ios_view}
## MODIFY FOR ANDROID ## MODIFY FOR ANDROID
#result.sub! /<head>/, '<head><base href="file:///Users/bterkuile/Documents/workspace/Qwaiter/assets/" target="_self" />' #result.sub! /<head>/, '<head><base href="file:///Users/bterkuile/Documents/workspace/Mozo/assets/" target="_self" />'
android_view = result.gsub /(href|src)="\/user\/([^"]+)/, %|\\1="/\\2| # replace absolute path names to relative ones android_view = result.gsub /(href|src)="\/user\/([^"]+)/, %|\\1="/\\2| # replace absolute path names to relative ones
android_view.gsub! /(href|src)="([^#])/, %|\\1="#{android_root_url}\\2| # replace relative uri's with android specific one android_view.gsub! /(href|src)="([^#])/, %|\\1="#{android_root_url}\\2| # replace relative uri's with android specific one
# android_view.sub! /<\/title>/, '</title><script type="text/javascript" src="qmobile.js"></script><script type="text/javascript" src="cordova-2.6.0rc1.js"></script><script type="text/javascript" src="barcodescanner.js"></script>' # android_view.sub! /<\/title>/, '</title><script type="text/javascript" src="qmobile.js"></script><script type="text/javascript" src="cordova-2.6.0rc1.js"></script><script type="text/javascript" src="barcodescanner.js"></script>'
+1 -1
View File
@@ -3,4 +3,4 @@
require ::File.expand_path('../config/environment', __FILE__) require ::File.expand_path('../config/environment', __FILE__)
#require 'faye' #require 'faye'
#use Faye::RackAdapter, :mount => '/faye', :timeout => 25 #use Faye::RackAdapter, :mount => '/faye', :timeout => 25
run Qwaiter::Application run Mozo::Application
+3 -3
View File
@@ -8,7 +8,7 @@ require 'action_mailer/railtie'
#require 'active_resource/railtie' #require 'active_resource/railtie'
require 'rails/test_unit/railtie' require 'rails/test_unit/railtie'
require 'sprockets/railtie' require 'sprockets/railtie'
require 'net/http' # lib/qwaiter/broadcaster/faye.rb require 'net/http' # lib/mozo/broadcaster/faye.rb
# custom override hack for the couchbase-setting gem, needs to be loaded before other gems, is settings only without dependencies # custom override hack for the couchbase-setting gem, needs to be loaded before other gems, is settings only without dependencies
#require File.expand_path('./../../lib/couchbase-setting', __FILE__) #require File.expand_path('./../../lib/couchbase-setting', __FILE__)
@@ -228,7 +228,7 @@ end
# This is a fix for testing models that # This is a fix for testing models that
# are frozen after destroy and then extended # are frozen after destroy and then extended
# by active_decorator when running the specs # by active_decorator when running the specs
module Qwaiter module Mozo
class Application < Rails::Application class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here. # Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers # Application configuration should go into files in config/initializers
@@ -322,5 +322,5 @@ module Qwaiter
config.assets.version = '1.0' config.assets.version = '1.0'
end end
end end
require 'qwaiter' require 'mozo'
require 'rqrcode-rails3' require 'rqrcode-rails3'
+4 -4
View File
@@ -3,17 +3,17 @@ defaults: &defaults
development: development:
<<: *defaults <<: *defaults
bucket: qwaiter_development bucket: mozo_development
test: test:
<<: *defaults <<: *defaults
bucket: qwaiter_test bucket: mozo_test
production: production:
<<: *defaults <<: *defaults
bucket: qwaiter bucket: mozo_backend
user_app: user_app:
<<: *defaults <<: *defaults
bucket: qwaiter_development bucket: mozo_development
+5 -5
View File
@@ -1,18 +1,18 @@
development: development:
validation_framework: :active_model #optional validation_framework: :active_model #optional
#database: "http://mozo:secret@localhost:5984/qwaiter_development" #database: "http://mozo:secret@localhost:5984/mozo_development"
database: "http://admin:<%= ENV['COUCHDB_ADMIN_PASSWORD']%>@localhost:5984/mozo_development" database: "http://admin:<%= ENV['COUCHDB_ADMIN_PASSWORD']%>@localhost:5984/mozo_development"
#database: mozo_development #database: mozo_development
test: test:
validation_framework: :active_model #optional validation_framework: :active_model #optional
#database: "http://mozo:secret@localhost:5984/qwaiter_test" #database: "http://mozo:secret@localhost:5984/mozo_test"
#Testing can only be done as couchdb admin, since it requires creating and destroying the database #Testing can only be done as couchdb admin, since it requires creating and destroying the database
database: "http://admin:<%= ENV['COUCHDB_ADMIN_PASSWORD']%>@localhost:5984/mozo_test" database: "http://admin:<%= ENV['COUCHDB_ADMIN_PASSWORD']%>@localhost:5984/mozo_test"
# database: "http://admin:secret@localhost:5984/qwaiter_test" # database: "http://admin:secret@localhost:5984/mozo_test"
production: production:
validation_framework: :active_model #optional validation_framework: :active_model #optional
database: "http://admin:<%= ENV['COUCHDB_ADMIN_PASSWORD']%>@localhost:5984/qwaiter" database: "http://admin:<%= ENV['COUCHDB_ADMIN_PASSWORD']%>@localhost:5984/mozo_backend"
#database: qwaiter #database: mozo
user_app: user_app:
validation_framework: :active_model #optional validation_framework: :active_model #optional
database: mozo_development database: mozo_development
+2 -2
View File
@@ -3,8 +3,8 @@
#require 'capistrano/local_precompile' #require 'capistrano/local_precompile'
set :application, 'mozo.bar' set :application, 'mozo.bar'
#set :repo_url, 'root@uflows.com:/var/git/qwaiter.git' #set :repo_url, 'root@uflows.com:/var/git/mozo.git'
set :repo_url, '/var/git/qwaiter.git' set :repo_url, '/var/git/mozo.git'
# Default branch is :master # Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call # ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call
+1 -1
View File
@@ -2,4 +2,4 @@
require File.expand_path('../application', __FILE__) require File.expand_path('../application', __FILE__)
# Initialize the rails application # Initialize the rails application
Qwaiter::Application.initialize! Mozo::Application.initialize!
+1 -1
View File
@@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
Qwaiter::Application.configure do Mozo::Application.configure do
# Settings specified here will take precedence over those in config/application.rb # Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on # In the development environment your application's code is reloaded on
+1 -1
View File
@@ -1,4 +1,4 @@
Qwaiter::Application.configure do Mozo::Application.configure do
# Settings specified here will take precedence over those in config/application.rb # Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests # Code is not reloaded between requests
+1 -1
View File
@@ -1,4 +1,4 @@
Qwaiter::Application.configure do Mozo::Application.configure do
# Settings specified here will take precedence over those in config/application.rb # Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's # The test environment is used exclusively to run your application's
+1 -1
View File
@@ -1,4 +1,4 @@
Qwaiter::Application.configure do Mozo::Application.configure do
# Settings specified here will take precedence over those in config/application.rb # Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests # Code is not reloaded between requests
@@ -13,7 +13,7 @@ module ActiveModel::SerializerSupport
end end
=begin =begin
class Qwaiter::JsonAdapter < ActiveModel::Serializer::Adapter::JsonApi class Mozo::JsonAdapter < ActiveModel::Serializer::Adapter::JsonApi
def add_resource_relationships_old1(attrs, serializer, options = {}) def add_resource_relationships_old1(attrs, serializer, options = {})
options[:add_included] = options.fetch(:add_included, true) options[:add_included] = options.fetch(:add_included, true)
serializer.associations.each do |association| #do |name, association, opts| serializer.associations.each do |association| #do |name, association, opts|
@@ -85,5 +85,5 @@ class Qwaiter::JsonAdapter < ActiveModel::Serializer::Adapter::JsonApi
end end
=end =end
#ActiveModel::Serializer.config.adapter = :json_api #ActiveModel::Serializer.config.adapter = :json_api
#ActiveModel::Serializer.config.adapter = Qwaiter::JsonAdapter #ActiveModel::Serializer.config.adapter = Mozo::JsonAdapter
#ActiveModel::Serializer.config.adapter = :flatten_json #ActiveModel::Serializer.config.adapter = :flatten_json
+2 -2
View File
@@ -1,4 +1,4 @@
module Qwaiter module Mozo
class FailureApp < Devise::FailureApp class FailureApp < Devise::FailureApp
def respond def respond
if request.format.json? if request.format.json?
@@ -267,7 +267,7 @@ Devise.setup do |config|
# change the failure app, you can configure them inside the config.warden block. # change the failure app, you can configure them inside the config.warden block.
# #
config.warden do |manager| config.warden do |manager|
manager.failure_app = Qwaiter::FailureApp manager.failure_app = Mozo::FailureApp
# manager.intercept_401 = false # manager.intercept_401 = false
# manager.default_strategies(:scope => :user).unshift :some_external_strategy # manager.default_strategies(:scope => :user).unshift :some_external_strategy
end end
+5 -5
View File
@@ -1,15 +1,15 @@
if Rails.env.development? if Rails.env.development?
Qwaiter.event_host = "http://localhost:9296/faye" Mozo.event_host = "http://localhost:9296/faye"
else else
Qwaiter.event_host = "https://events.mozo.bar/faye" Mozo.event_host = "https://events.mozo.bar/faye"
end end
Qwaiter.broadcaster = Qwaiter::Broadcaster::Faye.new Mozo.broadcaster = Mozo::Broadcaster::Faye.new
# use the connection from couchbase-structures/documents # use the connection from couchbase-structures/documents
# will be overwritten in the specs since flushing the real # will be overwritten in the specs since flushing the real
# thing is difficult # thing is difficult
# Qwaiter::Counter.connection = $cb unless Rails.env.test? # Mozo::Counter.connection = $cb unless Rails.env.test?
# Use the Drb counter # Use the Drb counter
Qwaiter::Counter.connection = Qwaiter::DrbCounter.object unless Rails.env.test? Mozo::Counter.connection = Mozo::DrbCounter.object unless Rails.env.test?
+2 -1
View File
@@ -4,4 +4,5 @@
# If you change this key, all old signed cookies will become invalid! # If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random, # Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks. # no regular words or you'll be exposed to dictionary attacks.
Qwaiter::Application.config.secret_token = 'a2d0002614aa5e1a04dd5f57c3a239765ee47df0f5e3214adf41c4893b84a95cd805f650f5edb321f2474adf6bb01a625b911d34a3c879815281d7e1db4415c8' #TODO: I think this one is no longer used and its just credentials now. Written when using rails 8.0.2
Mozo::Application.config.secret_token = 'a2d0002614aa5e1a04dd5f57c3a239765ee47df0f5e3214adf41c4893b84a95cd805f650f5edb321f2474adf6bb01a625b911d34a3c879815281d7e1db4415c8'
+2 -2
View File
@@ -1,8 +1,8 @@
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
Qwaiter::Application.config.session_store :cookie_store, key: '_qwaiter_session' Mozo::Application.config.session_store :cookie_store, key: '_mozo_session'
# Use the database for sessions instead of the cookie-based default, # Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information # which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration") # (create the session table with "rails generate session_migration")
# Qwaiter::Application.config.session_store :active_record_store # Mozo::Application.config.session_store :active_record_store
+1 -1
View File
@@ -1,5 +1,5 @@
ALLOWED_LOCALES = /nl|de|fr|en|es/ ALLOWED_LOCALES = /nl|de|fr|en|es/
Qwaiter::Application.routes.draw do Mozo::Application.routes.draw do
devise_for :users, controllers: { omniauth_callbacks: "users/omniauth_callbacks" } devise_for :users, controllers: { omniauth_callbacks: "users/omniauth_callbacks" }
#devise_for :suppliers, controllers: { confirmations: 'confirmations', registrations: 'registrations' } #devise_for :suppliers, controllers: { confirmations: 'confirmations', registrations: 'registrations' }
devise_for :employees, controllers: { devise_for :employees, controllers: {
+5 -5
View File
@@ -11,7 +11,7 @@ module CouchbaseSetting
end end
def self.bucket def self.bucket
config :bucket, default: 'qwaiter' config :bucket, default: 'mozo'
end end
def self.config(setting, default: nil) def self.config(setting, default: nil)
@@ -22,19 +22,19 @@ end
CouchbaseSetting.configs = { CouchbaseSetting.configs = {
supplier_counters: { supplier_counters: {
development: { development: {
bucket: 'qwaiter_development' bucket: 'mozo_development'
}, },
test:{ test:{
bucket: 'qwaiter_development' bucket: 'mozo_development'
}, },
production: {} production: {}
}, },
queue: { queue: {
development: { development: {
bucket: 'qwaiter_development' bucket: 'mozo_development'
}, },
test:{ test:{
bucket: 'qwaiter_development' bucket: 'mozo_development'
}, },
production: {} production: {}
} }
+1 -1
View File
@@ -1,4 +1,4 @@
module Qwaiter module Mozo
mattr_accessor :event_host mattr_accessor :event_host
mattr_accessor :broadcaster mattr_accessor :broadcaster
extend ActiveSupport::Autoload extend ActiveSupport::Autoload
@@ -1,4 +1,4 @@
module Qwaiter module Mozo
module Broadcaster module Broadcaster
extend ActiveSupport::Autoload extend ActiveSupport::Autoload
autoload :Faye autoload :Faye
@@ -1,8 +1,8 @@
module Qwaiter module Mozo
module Broadcaster module Broadcaster
class Faye class Faye
def broadcast(message) def broadcast(message)
@uri ||= URI.parse(Qwaiter.event_host) @uri ||= URI.parse(Mozo.event_host)
Net::HTTP.post_form(@uri, message: message.merge(ext: {auth_token: '6be65f9b5e7d21b8ca8de4ccfad5ba24cf40d440b370af79'}).to_json) Net::HTTP.post_form(@uri, message: message.merge(ext: {auth_token: '6be65f9b5e7d21b8ca8de4ccfad5ba24cf40d440b370af79'}).to_json)
rescue => e rescue => e
Rails.logger.error("[FAYE][ERROR] #{e.message}") Rails.logger.error("[FAYE][ERROR] #{e.message}")
@@ -1,4 +1,4 @@
module Qwaiter module Mozo
module Couchbase module Couchbase
def self.connection def self.connection
$cb $cb
@@ -18,7 +18,7 @@ module Qwaiter
def self.flush_counters! def self.flush_counters!
return unless connection.present? return unless connection.present?
design_doc('supplier').counters(reduce: false).each{|counter| Qwaiter::Counter.set counter.key, 0} design_doc('supplier').counters(reduce: false).each{|counter| Mozo::Counter.set counter.key, 0}
end end
end end
end end
@@ -1,4 +1,4 @@
module Qwaiter module Mozo
module Counter module Counter
mattr_accessor :connection mattr_accessor :connection
@@ -1,4 +1,4 @@
module Qwaiter module Mozo
module Distribution module Distribution
module DistributionMethods module DistributionMethods
def epsilon def epsilon
@@ -1,4 +1,4 @@
module Qwaiter module Mozo
module DrbCounter module DrbCounter
def self.object def self.object
require 'drb' require 'drb'
@@ -1,4 +1,4 @@
module Qwaiter::EmployeeBaseSerializer module Mozo::EmployeeBaseSerializer
extend ActiveSupport::Concern extend ActiveSupport::Concern
include JSONAPI::Serializer include JSONAPI::Serializer
included do included do
@@ -1,5 +1,5 @@
=begin =begin
module Qwaiter module Mozo
class Serializer < ActiveModel::Serializer class Serializer < ActiveModel::Serializer
def self.root=(val) def self.root=(val)
ActiveSupport::Deprecation.new('1.0', 'Mozo') ActiveSupport::Deprecation.new('1.0', 'Mozo')
@@ -1,4 +1,4 @@
module Qwaiter::SupplierBaseSerializer module Mozo::SupplierBaseSerializer
extend ActiveSupport::Concern extend ActiveSupport::Concern
include JSONAPI::Serializer include JSONAPI::Serializer
included do included do
@@ -1,4 +1,4 @@
module Qwaiter::UserBaseSerializer module Mozo::UserBaseSerializer
extend ActiveSupport::Concern extend ActiveSupport::Concern
include JSONAPI::Serializer include JSONAPI::Serializer
included do included do
@@ -1,4 +1,4 @@
module Qwaiter::WaiterBaseSerializer module Mozo::WaiterBaseSerializer
extend ActiveSupport::Concern extend ActiveSupport::Concern
include JSONAPI::Serializer include JSONAPI::Serializer
included do included do
+2 -2
View File
@@ -27,7 +27,7 @@ end
`rm -rf #{APP_ASSET_ROOT}` `rm -rf #{APP_ASSET_ROOT}`
`mkdir #{APP_ASSET_ROOT}` `mkdir #{APP_ASSET_ROOT}`
`rm -rf public/assets` `rm -rf public/assets`
`QWAITER_MOBILE_EXPORT=yes RAILS_ENV=user_app bundle exec rake assets:precompile` `MOZO_MOBILE_EXPORT=yes RAILS_ENV=user_app bundle exec rake assets:precompile`
`find public/assets -name "*.gz" -exec rm -f {} \\;` `find public/assets -name "*.gz" -exec rm -f {} \\;`
%w[ %w[
supplier supplier
@@ -70,7 +70,7 @@ end
# rm -rf public/assets/site; # rm -rf public/assets/site;
# rm -rf public/assets/cartoon; # rm -rf public/assets/cartoon;
# rm -rf public/assets/frames; # rm -rf public/assets/frames;
# QWAITER_MOBILE_EXPORT=yes RAILS_ENV=user_app TEST_HOST=$1 bundle exec rails runner bin/build_mobile_app.rb; # MOZO_MOBILE_EXPORT=yes RAILS_ENV=user_app TEST_HOST=$1 bundle exec rails runner bin/build_mobile_app.rb;
`rm -rf public/assets` `rm -rf public/assets`
# Set app versions # Set app versions
@@ -8,8 +8,8 @@ step "there is an active list and order" do
@order = create :order, user: @user, list: @list, supplier: @supplier, section: @section, state: 'placed' @order = create :order, user: @user, list: @list, supplier: @supplier, section: @section, state: 'placed'
@product_order = create :product_order, order: @order, product: @product, quantity: 3, price: 2.11, product_name: 'Old Product name' @product_order = create :product_order, order: @order, product: @product, quantity: 3, price: 2.11, product_name: 'Old Product name'
# @list.set_price.should == 6.33 # does not belong here, but good test. must take product order price above product price # @list.set_price.should == 6.33 # does not belong here, but good test. must take product order price above product price
Qwaiter::Counter.set "supplier_counter:#{@supplier.id}:orders_placed", 11 Mozo::Counter.set "supplier_counter:#{@supplier.id}:orders_placed", 11
Qwaiter::Counter.set "supplier_counter:#{@supplier.id}:orders_in_process", 7 Mozo::Counter.set "supplier_counter:#{@supplier.id}:orders_in_process", 7
end end
step "the supplier dashboard should display the active list" do step "the supplier dashboard should display the active list" do
@@ -1,14 +1,14 @@
require 'spec_helper' require 'spec_helper'
describe Qwaiter::Counter do describe Mozo::Counter do
describe 'couchbase connection', broken: true do # couchbase not used at the moment describe 'couchbase connection', broken: true do # couchbase not used at the moment
before do before do
@original_connection = Qwaiter::Counter.connection @original_connection = Mozo::Counter.connection
Qwaiter::Counter.connection = $cb Mozo::Counter.connection = $cb
end end
after do after do
Qwaiter::Counter.connection = @original_connection Mozo::Counter.connection = @original_connection
end end
describe '.incr' do describe '.incr' do
it 'sets nonexistent keys to 1' do it 'sets nonexistent keys to 1' do
@@ -1,7 +1,7 @@
# encoding: UTF-8 # encoding: UTF-8
require 'spec_helper' require 'spec_helper'
describe Qwaiter::Distribution do describe Mozo::Distribution do
describe 'distribute_lattice' do describe 'distribute_lattice' do
{ {
[20 , 10, 4] => [10.0, 5.0], [20 , 10, 4] => [10.0, 5.0],
@@ -15,7 +15,7 @@ describe Qwaiter::Distribution do
[13.6, 40, 10] => [ 6.8, 8.0], [13.6, 40, 10] => [ 6.8, 8.0],
[40, 40, 23] => [ 8.0, 8.0], [40, 40, 23] => [ 8.0, 8.0],
}.each do |params, result| }.each do |params, result|
it("handles #{params.join(', ')}"){ Qwaiter::Distribution.distribute_lattice(*params).should == result } it("handles #{params.join(', ')}"){ Mozo::Distribution.distribute_lattice(*params).should == result }
end end
end end
end end
+8 -8
View File
@@ -49,8 +49,8 @@ describe Order do
describe 'counters' do describe 'counters' do
before do before do
# hack some initial values # hack some initial values
Qwaiter::Counter.set "supplier_counter:#{supplier.id}:orders_placed", 11 Mozo::Counter.set "supplier_counter:#{supplier.id}:orders_placed", 11
Qwaiter::Counter.set "supplier_counter:#{supplier.id}:orders_in_process", 7 Mozo::Counter.set "supplier_counter:#{supplier.id}:orders_in_process", 7
end end
it 'reduces the orders_placed count and communicates it to user' do it 'reduces the orders_placed count and communicates it to user' do
@@ -89,8 +89,8 @@ describe Order do
describe 'counters' do describe 'counters' do
before do before do
# hack some initial values # hack some initial values
Qwaiter::Counter.set "supplier_counter:#{supplier.id}:orders_placed", 11 Mozo::Counter.set "supplier_counter:#{supplier.id}:orders_placed", 11
Qwaiter::Counter.set "supplier_counter:#{supplier.id}:orders_in_process", 7 Mozo::Counter.set "supplier_counter:#{supplier.id}:orders_in_process", 7
end end
it 'decreases the orders_in_process count and communicates it to user' do it 'decreases the orders_in_process count and communicates it to user' do
@@ -123,8 +123,8 @@ describe Order do
describe 'counters' do describe 'counters' do
before do before do
# hack some initial values # hack some initial values
Qwaiter::Counter.set "supplier_counter:#{supplier.id}:orders_placed", 11 Mozo::Counter.set "supplier_counter:#{supplier.id}:orders_placed", 11
Qwaiter::Counter.set "supplier_counter:#{supplier.id}:orders_in_process", 7 Mozo::Counter.set "supplier_counter:#{supplier.id}:orders_in_process", 7
end end
it 'decreases the placed count and communicates it to user when state is placed through the order_cancelled broadcast message' do it 'decreases the placed count and communicates it to user when state is placed through the order_cancelled broadcast message' do
@@ -157,8 +157,8 @@ describe Order do
describe 'counters' do describe 'counters' do
before do before do
# hack some initial values # hack some initial values
Qwaiter::Counter.set "supplier_counter:#{supplier.id}:orders_placed", 11 Mozo::Counter.set "supplier_counter:#{supplier.id}:orders_placed", 11
Qwaiter::Counter.set "supplier_counter:#{supplier.id}:orders_in_process", 7 Mozo::Counter.set "supplier_counter:#{supplier.id}:orders_in_process", 7
end end
it "decrements the orders_placed_count for when a placed order is closed" do it "decrements the orders_placed_count for when a placed order is closed" do
+4 -4
View File
@@ -15,16 +15,16 @@ describe Supplier::Counters do
end end
# it 'cleans counter values if orders are no longer available', broken: defined?($cb) do # it 'cleans counter values if orders are no longer available', broken: defined?($cb) do
# old_connection = Qwaiter::Counter.connection # old_connection = Mozo::Counter.connection
# # this spec should run on the couchbase database # # this spec should run on the couchbase database
# Qwaiter::Counter.connection = $cb # Mozo::Counter.connection = $cb
# supplier = create :supplier # supplier = create :supplier
# Qwaiter::Counter.set "supplier_counter:#{supplier.id}:orders_placed", 9 # Mozo::Counter.set "supplier_counter:#{supplier.id}:orders_placed", 9
# supplier.orders_placed_count.should == 9 # supplier.orders_placed_count.should == 9
# Supplier.reset_counters! # Supplier.reset_counters!
# sleep 1 # sleep 1
# supplier.orders_placed_count.should == 0 # supplier.orders_placed_count.should == 0
# Qwaiter::Counter.connection = old_connection # Mozo::Counter.connection = old_connection
# end # end
# #
it 'sets the counters to the right values for one supplier' do it 'sets the counters to the right values for one supplier' do
+1 -1
View File
@@ -76,7 +76,7 @@ describe Supplier do
describe '#decrement_orders_placed_count!' do describe '#decrement_orders_placed_count!' do
it 'decreases orders_placed' do it 'decreases orders_placed' do
Qwaiter::Counter.set "supplier_counter:#{supplier.id}:orders_placed", 9 Mozo::Counter.set "supplier_counter:#{supplier.id}:orders_placed", 9
supplier.decrement_orders_placed_count!.should == 8 supplier.decrement_orders_placed_count!.should == 8
end end
end end
+4 -4
View File
@@ -43,7 +43,7 @@ end
module BroadcastHelpers module BroadcastHelpers
def expect_broadcast(obj) def expect_broadcast(obj)
expect(Qwaiter.broadcaster).to receive(:broadcast).with(obj) expect(Mozo.broadcaster).to receive(:broadcast).with(obj)
end end
end end
@@ -189,13 +189,13 @@ RSpec.configure do |config|
# instead of true. # instead of true.
#config.use_transactional_fixtures = true #config.use_transactional_fixtures = true
config.before :suite do config.before :suite do
Qwaiter::Couchbase.load_design_docs! Mozo::Couchbase.load_design_docs!
Qwaiter::Counter.connection = TestCounter.new Mozo::Counter.connection = TestCounter.new
end end
config.before :each do config.before :each do
CouchPotato.couchrest_database.recreate! CouchPotato.couchrest_database.recreate!
Qwaiter::Counter.connection.flush Mozo::Counter.connection.flush
end end
config.before :each, type: :feature do config.before :each, type: :feature do
+2 -2
View File
@@ -3,9 +3,9 @@ require 'spec_helper'
describe 'Serializers' do describe 'Serializers' do
let(:serializer_classes){ Dir.glob(Rails.root.join('app/serializers/*_serializer.rb')).map{|f| File.basename(f).sub(/\.rb$/,'').classify.constantize}} let(:serializer_classes){ Dir.glob(Rails.root.join('app/serializers/*_serializer.rb')).map{|f| File.basename(f).sub(/\.rb$/,'').classify.constantize}}
describe 'classes' do describe 'classes' do
it 'inherits from Qwaiter::Serializer' do it 'inherits from Mozo::Serializer' do
serializer_classes.each do |serializer| serializer_classes.each do |serializer|
serializer.ancestors.should include Qwaiter::Serializer serializer.ancestors.should include Mozo::Serializer
end end
end end
end end
@@ -17,11 +17,11 @@ module Matchers
end end
def matches?(block) def matches?(block)
old_broadcaster = Qwaiter.broadcaster old_broadcaster = Mozo.broadcaster
test_broadcaster = TestBroadcaster.new test_broadcaster = TestBroadcaster.new
Qwaiter.broadcaster = test_broadcaster Mozo.broadcaster = test_broadcaster
block.call block.call
Qwaiter.broadcaster = old_broadcaster Mozo.broadcaster = old_broadcaster
relevant_broadcasts = test_broadcaster.broadcasts.select{|b| b[:channel] =~ /^\/supplier\/#{@supplier_id}/ && b[:data][:event] == @message} relevant_broadcasts = test_broadcaster.broadcasts.select{|b| b[:channel] =~ /^\/supplier\/#{@supplier_id}/ && b[:data][:event] == @message}
@failure_debug_content = "was #{relevant_broadcasts.map{|b| b[:data][:data].inspect}.join(" and ")}" @failure_debug_content = "was #{relevant_broadcasts.map{|b| b[:data][:data].inspect}.join(" and ")}"
@@ -18,11 +18,11 @@ module Matchers
end end
def matches?(block) def matches?(block)
old_broadcaster = Qwaiter.broadcaster old_broadcaster = Mozo.broadcaster
test_broadcaster = TestBroadcaster.new test_broadcaster = TestBroadcaster.new
Qwaiter.broadcaster = test_broadcaster Mozo.broadcaster = test_broadcaster
block.call block.call
Qwaiter.broadcaster = old_broadcaster Mozo.broadcaster = old_broadcaster
relevant_broadcasts = test_broadcaster.broadcasts.select{|b| b[:channel] =~ /^\/user\/#{@user_id}/ && b[:data][:event] == @message} relevant_broadcasts = test_broadcaster.broadcasts.select{|b| b[:channel] =~ /^\/user\/#{@user_id}/ && b[:data][:event] == @message}
@failure_message = "User #{@user_id} did not receive any broadcasts" and return false if relevant_broadcasts.empty? @failure_message = "User #{@user_id} did not receive any broadcasts" and return false if relevant_broadcasts.empty?