Skip to content

Instantly share code, notes, and snippets.

@bloopletech
Created November 10, 2011 12:28
Show Gist options
  • Save bloopletech/1354749 to your computer and use it in GitHub Desktop.
Save bloopletech/1354749 to your computer and use it in GitHub Desktop.
def store_dir
"uploads/" + case model.class
when Gallery
model.gallery.page.site.id
when Content
model.content.page.site.id
when MenuCategory
model.menu_category.menu.page.site.id
else
model.site.id
end + "/"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment