Fix a postgresql warning about OID 705 when running rspec tests #76
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello ! This time with test passing, it was a small bug sorry for the duplicate PR
This warning is displayed when running test with rspec and postgresql :
unknown OID 705: failed to recognize type of 'read_mark_reader_type'. It will be treated as String.
You can see this warning in the project travis logs : https://travis-ci.org/ledermann/unread/jobs/118972216
And the result with the fix : https://travis-ci.org/jumichot/unread/jobs/136720171
Reading this rails PR the
fix for postgresql is to cast values when using 'AS' in custom queries.
Introduce that specific check for postgres seems ugly, but the problem appears only for postgres.
My second problem is the duplication, I don't know where to put a method that would the cast in both places. I'm not sure what would be the proper way to fix it, so I can make some changes if needed ;).