Skip to content

Instantly share code, notes, and snippets.

@travisdmathis
Created December 11, 2014 18:11
Show Gist options
  • Save travisdmathis/3bf7d843ab775306bff2 to your computer and use it in GitHub Desktop.
Save travisdmathis/3bf7d843ab775306bff2 to your computer and use it in GitHub Desktop.
child = catalog.create_child(folder.name, user)
if child.valid?
child
else
child = current_user.catalogs.find_by_name(folder.name)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment