Implement spring and reset counters functionality
This commit is contained in:
+2
-1
@@ -26,7 +26,8 @@ class Order
|
||||
}
|
||||
}], reduce_function: '_sum'
|
||||
|
||||
view :by_supplier_id_and_id, key: [:supplier_id, :_id] # Do not comment me out
|
||||
view :by_supplier_id_and_id, key: [:supplier_id, :_id] # Do not comment me out this is for security, TODO: make the security server side for speed and space optimization
|
||||
view :by_supplier_id_and_state, key: [:supplier_id, :state], reduce_function: '_sum'
|
||||
|
||||
def self.for_supplier(supplier, options = {})
|
||||
total_entries = database.view(by_supplier_id_and_id({startkey: ["#{supplier.id}\u9999"], endkey: [supplier.id], include_docs: false, reduce: true, descending: true}))
|
||||
|
||||
Reference in New Issue
Block a user