Class: JsonApiServer::PgJsonbArray

Inherits:
FilterBuilder show all
Defined in:
lib/json_api_server/filter_builders.rb

Overview

Searches a jsonb array [‘foo’, ‘bar’]. If multiple values passed, it performs an OR search ?|. Case sensitive search. Postgres only.

Instance Attribute Summary

Attributes inherited from FilterBuilder

#attr, #column_name, #config, #operator, #value

Instance Method Summary collapse

Methods inherited from FilterBuilder

#initialize

Constructor Details

This class inherits a constructor from JsonApiServer::FilterBuilder

Instance Method Details

#to_query(model) ⇒ Object



113
114
115
# File 'lib/json_api_server/filter_builders.rb', line 113

def to_query(model)
  model.where("#{full_column_name(model)} ?| array[:name]", name: value)
end