Library catalog in ruby and Postgres SQL