I just encountered something rather surprising with the where
method. When I query something like MyModel.where(id: '121-fake')
, it gets translated to id = 121
in SQL, i.e. ActiveRecord appears to remove what's after the dash. This seems to only happen when I query with id
. Can anyone help point me to where this is implemented? Thanks.
Asked
Active
Viewed 22 times
0

EJAg
- 3,210
- 2
- 14
- 22