def deal_with_abnormalaties
      self.cover_image = upload_images(cover_image, post_type.to_s + '/' + id.to_s, 'posts') if cover_image.class != String && cover_image.class != NilClass
      # if the slug is empty it will take the title and create a slug
      self.post_slug = 
        if post_slug.blank?
          post_title.gsub(' ', '-').downcase.gsub(/[^a-z0-9\-\s]/i, '')
        else
          post_slug.gsub(' ', '-').downcase.gsub(/[^a-z0-9\-\s]/i, '')
        end

      # if post status is left blank it will set the status to draft
      self.post_status = 'Draft' if post_status.blank?

      # if the post has a parent it will prefix the structured url with its parents url
      self.structured_url = 
        if parent_id
          "#{parent.structured_url}/#{post_slug}"
        else
          "/#{post_slug}"
        end

    end
def deal_with_abnormalaties
      self.cover_image = upload_images(cover_image, post_type.to_s + '/' + id.to_s, 'posts') if cover_image.class != String && cover_image.class != NilClass
      # if the slug is empty it will take the title and create a slug
      self.post_slug = 
        if post_slug.blank?
          post_title.gsub(' ', '-').downcase.gsub(/[^a-z0-9\-\s]/i, '')
        else
          post_slug.gsub(' ', '-').downcase.gsub(/[^a-z0-9\-\s]/i, '')
        end

      # if post status is left blank it will set the status to draft
      self.post_status = 'Draft' if post_status.blank?

      # if the post has a parent it will prefix the structured url with its parents url
      self.structured_url = 
        if parent_id
          "#{parent.structured_url}/#{post_slug}"
        else
          "/#{post_slug}"
        end

    end
will make sure that specific data is correctly formatted for the database