Method: Contentstack::Query#remove_query
- Defined in:
- lib/contentstack/query.rb
#remove_query(field_uid) ⇒ Contentstack::Query
Remove provided query key from custom query if exist. Example:
@query = @stack.content_type('blog').query
@query.remove_query('author')
56 57 58 59 60 61 |
# File 'lib/contentstack/query.rb', line 56 def remove_query(field_uid) q = ActiveSupport::JSON.decode(@query[:query]) q.delete(field_uid) @query[:query] = ActiveSupport::JSON.encode(q) self end |