<commit_before>module Spree
  module Blog
    class Post < Spree::Base
      # Avoid conflicts by being more specific than 'spree_posts'
      self.table_name = 'spree_blog_posts'

      default_scope { order(created_at: :desc) }

      extend FriendlyId
      friendly_id :slug_candidates, use: :slugged

      belongs_to :category
      has_and_belongs_to_many :tags

      validates :slug, length: { minimum: 3 }
      validates :slug, uniqueness: true

      before_validation :normalize_slug, on: :update

      has_attached_file :attachment,
                        styles: { standard: '1800x800>', square: '600x600#' },
                        default_style: :standard,
                        url: 'spree/blog/:id/:style/:basename.:extension',
                        path: ':url',
                        convert_options: { all: '-strip -auto-orient -colorspace sRGB' }
      validates_attachment_content_type :attachment, :content_type => ["image/jpg", "image/jpeg", "image/png", "image/gif"]

      def normalize_slug
        self.slug = normalize_friendly_id(slug)
      end

      # Try building a slug based on the following fields in increasing order of specificity.
      def slug_candidates
        [
            :title,
            [:created_at, :title]
        ]
      end
    end
  end
end<commit_msg>updated photo size<commit_after>module Spree
  module Blog
    class Post < Spree::Base
      # Avoid conflicts by being more specific than 'spree_posts'
      self.table_name = 'spree_blog_posts'

      default_scope { order(created_at: :desc) }

      extend FriendlyId
      friendly_id :slug_candidates, use: :slugged

      belongs_to :category
      has_and_belongs_to_many :tags

      validates :slug, length: { minimum: 3 }
      validates :slug, uniqueness: true

      before_validation :normalize_slug, on: :update

      has_attached_file :attachment,
                        styles: { standard: '1200x1600>', square: '600x600#' },
                        default_style: :standard,
                        url: 'spree/blog/:id/:style/:basename.:extension',
                        path: ':url',
                        convert_options: { all: '-strip -auto-orient -colorspace sRGB' }
      validates_attachment_content_type :attachment, :content_type => ["image/jpg", "image/jpeg", "image/png", "image/gif"]

      def normalize_slug
        self.slug = normalize_friendly_id(slug)
      end

      # Try building a slug based on the following fields in increasing order of specificity.
      def slug_candidates
        [
            :title,
            [:created_at, :title]
        ]
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09138972809667674, 'fraction_numerical': 0.01095166163141994, 'mean_word_length': 2.1573301549463646, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6788477', 'n_tokens_mistral': 794, 'n_tokens_neox': 748, 'n_words': 195}