ruby with active record and postgres