Possibly wrong `numericality` validation in `tunez` repo
Hello, I know this is a bit silly but considering that it's being accompanied by a book I thought I'd let you know that, unless I am misunderstanding something, in the Album Resource the
year_released
validation is slightly off.
https://github.com/sevenseacat/tunez/blob/81078dc05cf42fa80945c33b6f90debab76700b2/lib/tunez/music/album.ex#L75-L80
The year must be in the range (1950, next_year)
, whereas currently it validates it to be in the range (1950, next_year]
.
->
Also, I didn't know where to post this and didn't want to spam the general
channel, so if this is the wrong place... oops.GitHub
tunez/lib/tunez/music/album.ex at 81078dc05cf42fa80945c33b6f90debab...
The starter application for the Ash Framework book - sevenseacat/tunez
Solution:Jump to solution
huh. you're right! the message is slightly incorrect - but the code reflects my intention
4 Replies
Solution
huh. you're right! the message is slightly incorrect - but the code reflects my intention
ohh ok got it!
unfortunately it's a bit late to change it in the book 😅 but I hope that little issue doesn't detract from your understanding, given you've spotted that oops!
yea, no worries!