def blog__sync_config_post_field(post, key, content)
      db_post_field = LatoBlog::PostField.find_by(
        key: key,
        lato_blog_post_id: post.id,
        lato_blog_post_field_id: nil
      )
      # check if post field can be created for the post
      if content[:categories] && !content[:categories].empty?
        db_categories = LatoBlog::Category.where(meta_permalink: content[:categories])
        return if (post.categories.pluck(:id) & db_categories.pluck(:id)).empty?
      end
      # run correct action for field
      if db_post_field
        blog__update_db_post_field(db_post_field, content)
      else
        blog__create_db_post_field(post, key, content)
      end
    end
def blog__sync_config_post_field(post, key, content)
      db_post_field = LatoBlog::PostField.find_by(
        key: key,
        lato_blog_post_id: post.id,
        lato_blog_post_field_id: nil
      )
      # check if post field can be created for the post
      if content[:categories] && !content[:categories].empty?
        db_categories = LatoBlog::Category.where(meta_permalink: content[:categories])
        return if (post.categories.pluck(:id) & db_categories.pluck(:id)).empty?
      end
      # run correct action for field
      if db_post_field
        blog__update_db_post_field(db_post_field, content)
      else
        blog__create_db_post_field(post, key, content)
      end
    end
This function syncronizes a single post field of a specific post with database.