I have two objects @tracks (enumerated) and @artist, and I would like to create an enumerated with all the tracks and the artist in them. This means that I can pass them to the method that will be executed (each track and artist has change events):
change_events = object.map(&:change_events).flatten
My idea:
objects = @artist.tracks
objects << @artist
but this gives me this error for the second line (which makes sense, but I don't know how to fix it):
Track(#17816) expected, got Artist(#17572)
Any ideas on how I could do this would be appreciated!
source
share