I have a field in animal_food (a json object) called treats and I want to add a field in treats called time_eaten and then return everything from the field treats.
def addTime(time)
animal_food["treats"]["time_eaten"] = time
animal_food["treats"]
end
Is there a way I can do the code above in 1 line (using merge or other ruby syntax?)