Skip to content

Commit 984ca3a

Browse files
committed
Add provision for selecting locale in the query
1 parent e0a6695 commit 984ca3a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/contentstack/query.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,20 @@ def descending(field_uid)
370370
self
371371
end
372372

373+
# Get entries from the specified locale.
374+
#
375+
# @param [String] code The locale code of the entry
376+
#
377+
# Example
378+
# @query = @stack.content_type('category').query
379+
# @query.locale('en-us')
380+
#
381+
# @return [Contentstack::Query]
382+
def locale(code)
383+
@query[:locale] = code
384+
self
385+
end
386+
373387
# Specifies an array of 'only' keys in BASE object that would be 'included' in the response.
374388
#
375389
# @param [Array] fields Array of the 'only' reference keys to be included in response.

0 commit comments

Comments
 (0)