Skip to content

Instantly share code, notes, and snippets.

@sandro
Created July 18, 2011 21:59
Show Gist options
  • Save sandro/1090778 to your computer and use it in GitHub Desktop.
Save sandro/1090778 to your computer and use it in GitHub Desktop.
def update_main_artist
artist = artists.first
if rovi_artist
artist = Artist.create(:name => rovi_artist.name)
end
update_attribute :main_artist_id, artist.id
end
def update_main_artist
if rovi_artist
artist = Artist.create(:name => rovi_artist.name)
else
artist = artists.first
end
update_attribute :main_artist_id, artist.id
end
def update_main_artist
artist = catch(:artist) do
if rovi_artist
throw(:artist, Artist.create(:name => rovi_artist.name))
end
artists.first
end
update_attribute :main_artist_id, artist.id
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment