Skip to content

Commit

Permalink
[UCMS-11864] Add hint argument to Fish0::Repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Udalov Igor committed May 6, 2024
1 parent 6893416 commit d003989
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Fish0 0.2.2 (May, 06, 2024) ##

* Added `hint` argument to `Fish0::Repository` in order to force usage of specific index(-es).

## Fish0 0.2.1 (May, 11, 2023) ##

* Update required Ruby version from `~>2.0` to `>=2.0`.
Expand Down
6 changes: 6 additions & 0 deletions lib/fish0/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ def skip(value)
self
end

def hint(value)
@hint = value
self
end

def scope(name, body)
return if respond_to?(name)

Expand All @@ -105,6 +110,7 @@ def fetch
scoped = scoped.projection(@projection) if @projection
scoped = scoped.skip(skip_quantity) if skip_quantity.positive?
scoped = scoped.limit(limit_quantity) if limit_quantity.positive?
scoped = scoped.hint(@hint) if @hint
scoped
end

Expand Down
2 changes: 1 addition & 1 deletion lib/fish0/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Fish0
VERSION = '0.2.1'.freeze
VERSION = '0.2.2'.freeze
end

0 comments on commit d003989

Please sign in to comment.