Rails Postgres String Contains Python Method Vs Function