Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Please mark backwards incompatible changes with an exclamation mark at the start

## [Unreleased]

### Fixed
- `PropertiesFetcher#last` now correctly returns the last set of properties
(ordered chronologically).

## [29.3.0] - 2025-12-11

### Added
Expand Down
2 changes: 1 addition & 1 deletion lib/jay_api/properties_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def and
# @return [Hash, nil] The last set of properties (ordered chronologically)
# or +nil+ if no properties are found.
def last
sort_records('asc').size(1)
sort_records('desc').size(1)
fetch_properties.last
end

Expand Down
2 changes: 1 addition & 1 deletion spec/jay_api/properties_fetcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@

shared_examples_for '#last' do
it 'adds a sorting clause to the query' do
expect(query_builder).to receive(:sort).with('timestamp' => 'asc')
expect(query_builder).to receive(:sort).with('timestamp' => 'desc')
method_call
end

Expand Down