Added to_array method in Model