Switch to official couch_potato version
This commit is contained in:
@@ -66,13 +66,18 @@ class Supplier
|
||||
|
||||
def reset_order_counters_with_spec(spec)
|
||||
# taken from the couch_potato source since we want a model/custom mix here (hmmmm, something that should be fixed in the couchbase version)
|
||||
results = CouchPotato::View::ViewQuery.new(
|
||||
view_spec = {spec.view_name => { map: spec.map_function, reduce: spec.reduce_function} }
|
||||
list_spec = spec.list_name.nil? ? nil : {spec.list_name => spec.list_function}
|
||||
lib_spec = nil # do not yet know meaning of this param
|
||||
query_view = CouchPotato::View::ViewQuery.new(
|
||||
database.couchrest_database,
|
||||
spec.design_document,
|
||||
{spec.view_name => { map: spec.map_function, reduce: spec.reduce_function} },
|
||||
({spec.list_name => spec.list_function} unless spec.list_name.nil?),
|
||||
view_spec,
|
||||
list_spec,
|
||||
lib_spec,
|
||||
spec.language
|
||||
).query_view!(spec.view_parameters)
|
||||
)
|
||||
results = query_view.query_view!(spec.view_parameters)
|
||||
Array.wrap(results['rows']).each do |result|
|
||||
supplier_id, state = result['key']
|
||||
case state
|
||||
|
||||
Reference in New Issue
Block a user