<commit_before># == Schema Information
# Schema version: 20181126085723
#
# Table name: cms_files
#
#  id                   :integer(4)      not null, primary key
#  user_id              :integer(4)
#  title                :string(255)
#  description          :text
#  state                :string(255)
#  cmsfile_file_name    :string(255)
#  cmsfile_content_type :string(255)
#  cmsfile_file_size    :integer(4)
#  cmsfile_updated_at   :datetime
#  created_at           :datetime
#  updated_at           :datetime
#  tags                 :string(255)
#

class CmsFile < ActiveRecord::Base

  acts_as_item

  has_attached_file :cmsfile,
    :url =>    "/uploaded_files/cmsfile/:id/:style/:basename.:extension",
    :path => ":rails_root/public/uploaded_files/cmsfile/:id/:style/:basename.:extension"
  validates_attachment_presence :cmsfile
  validates_attachment_content_type :cmsfile, :content_type => ['application/pdf', 'text/plain','application/octet-stream','application/msword']<commit_msg>open type for cms file<commit_after># == Schema Information
# Schema version: 20181126085723
#
# Table name: cms_files
#
#  id                   :integer(4)      not null, primary key
#  user_id              :integer(4)
#  title                :string(255)
#  description          :text
#  state                :string(255)
#  cmsfile_file_name    :string(255)
#  cmsfile_content_type :string(255)
#  cmsfile_file_size    :integer(4)
#  cmsfile_updated_at   :datetime
#  created_at           :datetime
#  updated_at           :datetime
#  tags                 :string(255)
#

class CmsFile < ActiveRecord::Base

  acts_as_item

  has_attached_file :cmsfile,
    :url =>    "/uploaded_files/cmsfile/:id/:style/:basename.:extension",
    :path => ":rails_root/public/uploaded_files/cmsfile/:id/:style/:basename.:extension"
  validates_attachment_presence :cmsfile
  # TODO check all the content types allowed for the validation
#	validates_attachment_content_type :cmsfile, :content_type => [
#		'application/pdf', 'text/plain','application/octet-stream','application/msword', 'application/rtf']
{'fraction_non_alphanumeric': 0.11435406698564593, 'fraction_numerical': 0.03062200956937799, 'mean_word_length': 3.068093385214008, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 9, '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': '4588081', 'n_tokens_mistral': 714, 'n_tokens_neox': 668, 'n_words': 122}