Skip to content

Instantly share code, notes, and snippets.

@leshill
Forked from sandro/idiomatic_throw_catch?.rb
Created July 18, 2011 22:23
Show Gist options
  • Save leshill/1090841 to your computer and use it in GitHub Desktop.
Save leshill/1090841 to your computer and use it in GitHub Desktop.
def update_main_artist
artist = if rovi_artist
Artist.create(:name => rovi_artist.name)
else
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