Sha256: 3d75bef8612d623800ead180099603f750345aea2757065e3b94526116a5861f
Contents?: true
Size: 423 Bytes
Versions: 9
Compression:
Stored size: 423 Bytes
Contents
module Ecom module Core class FilterService def get_filtered_data(type, filters) positive = {} negative = {} obj = type.constantize filters.each { |f| if f[:cond] == 'P' positive[f[:key]] = f[:value] else negative[f[:key]] = f[:value] end } obj.where(positive).where.not(negative) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems