added sync_tags method to Snippet model to avoid code duplication in Snippet controller