jonmorten / diktkassa

A digital baby hatch for poems
4 stars 0 forks source link

Random poem when there are missing poem DB indices #12

Closed jonmorten closed 9 years ago

jonmorten commented 9 years ago

I think the random poem method has flaw. If we remove poems from the DB, there will be missing indices in the table, and the Poem::find(ID) could attempt to get an index that does not exist.

https://github.com/jjmmkk/diktkassa/blob/782276590ae8f669a2d23729a3fcc0d5bd633196/app/controllers/PoemController.php#L59-L61