postgresql - Rails find_by_sql not returning results -
so query running returning array id , nothing else. when run same query in psql returns correct records. idea why be, or if there may better way of executing query?
rails console
numbers = robodial.find_by_sql "select p.id, p.nam_last, w.warn_closed_date, w.warn_date_issued, pn.phone_number, w.collection_amount people p left outer join warrants w on p.id = w.person_id left outer join pn on p.id = pn.person_id p.id = 81437"
returns not correct
[#<robodial id: 81437>, #<robodial id: 81437>]
am doing wrong here? when run same query in psql
session returns correct values.
correct values include below
p.id, p.nam_last, w.warn_closed_date, w.warn_date_issued, pn.phone_number, w.collection_amount
Comments
Post a Comment