<commit_before>module OrdinaryCms
  module Mercury
    class Image
      include Mongoid::Document
      include Mongoid::Paperclip

      has_mongoid_attached_file :image

      validates_presence_of :image

      delegate :url, :to => :image

      def serializable_hash(options = nil)
        options ||= {}
        options[:methods] ||= []
        options[:methods] << :url
        super(options)
      end
    end
  end
end<commit_msg>rails4 paperclip<commit_after>module OrdinaryCms
  module Mercury
    class Image
      include Mongoid::Document
      include Mongoid::Paperclip

      has_mongoid_attached_file :image


      validates_presence_of :image
      validates_attachment_content_type :attachment, content_type: %w(image/jpg image/jpeg image/png)

      delegate :url, :to => :image

      def serializable_hash(options = nil)
        options ||= {}
        options[:methods] ||= []
        options[:methods] << :url
        super(options)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08823529411764706, 'fraction_numerical': 0.0010141987829614604, 'mean_word_length': 2.6555555555555554, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '3734369', 'n_tokens_mistral': 297, 'n_tokens_neox': 281, 'n_words': 66}