You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into this rare issue where I have a model PlaylistTrack and when I call find(id) it throws this error: ArgumentError: invalid range "r-0" in string transliteration.
The issue was resolved after adding an explicit pepper to something else instead of the implicit "playlist_tracks":
class PlaylistTrack < ApplicationRecord
include Hashid::Rails
hashid_config pepper: "playlisttracks"
...
end
Using this pepper resulted in the @guards being "y7d" instead which is accepted.
I guess its just by chance that "playlist_tracks" produces a problematic pepper but this could potentially be a problem with other table names as well.
The text was updated successfully, but these errors were encountered:
I ran into this rare issue where I have a model
PlaylistTrack
and when I callfind(id)
it throws this error:ArgumentError: invalid range "r-0" in string transliteration
.The error is thrown from the hashids gem with
@guards
being"r-0"
https://github.com/peterhellberg/hashids.rb/blob/b729fe514e492e18d9f69473b53eb59a3b5aee4b/lib/hashids.rb#L117The issue was resolved after adding an explicit pepper to something else instead of the implicit
"playlist_tracks"
:Using this pepper resulted in the
@guards
being"y7d"
instead which is accepted.I guess its just by chance that
"playlist_tracks"
produces a problematic pepper but this could potentially be a problem with other table names as well.The text was updated successfully, but these errors were encountered: