Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
tags.each { |tag| tag_list << Tag.first_or_create(:name => tag.strip) }
tags.each do |tag|
tag.strip!
tag_object = Tag.find_by_name(tag)
tag_object = Tag.create!(:name => tag) if tag_object.nil?
tag_list << tag_object
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment