Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix predecessor of current record #202

Merged
merged 1 commit into from
Jun 4, 2023

Conversation

tagliala
Copy link
Member

@tagliala tagliala commented Jun 2, 2023

Order of history on current record was not correct, so pred returned
the second element of the history

This commit uses reverse_order to allow Active Record to properly
reorder history. This change replaces

ORDER BY lower(validity) ASC, upper(validity) DESC

with a better

ORDER BY lower(validity) DESC

and also uses second instead of offset(1).first for clarity

Fix #201

@tagliala tagliala force-pushed the bugfix/201-fix-pred-on-current-record branch 2 times, most recently from bd394e0 to 3f1622f Compare June 2, 2023 16:30
@tagliala tagliala changed the title Fix predecessor Fix predecessor of current element Jun 2, 2023
@tagliala tagliala force-pushed the bugfix/201-fix-pred-on-current-record branch from 3f1622f to 5df11d5 Compare June 2, 2023 16:40
Order of history on current record was not correct, so `pred` returned
the second element of the history

This commit uses `reverse_order` to allow Active Record to properly 
reorder history. This change replaces

```sql
ORDER BY lower(validity) ASC, upper(validity) DESC
```

with a better

```sql
ORDER BY lower(validity) DESC
```

and also uses `second` instead of `offset(1).first` for clarity

Fix #201
@tagliala tagliala force-pushed the bugfix/201-fix-pred-on-current-record branch from 5df11d5 to 0646270 Compare June 2, 2023 16:47
@tagliala tagliala marked this pull request as ready for review June 2, 2023 16:47
@tagliala tagliala changed the title Fix predecessor of current element Fix predecessor of current record Jun 2, 2023
@tagliala tagliala merged commit a3dc7d4 into master Jun 4, 2023
@tagliala tagliala deleted the bugfix/201-fix-pred-on-current-record branch June 4, 2023 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pred does not work on current record when there is not an associated timeline
1 participant