<commit_before># http://robots.thoughtbot.com/prevent-spoofing-with-paperclip
# allow stl files to be uploaded
Paperclip.options[:content_type_mappings] = {
  :stl => "text/plain"
}

# We use ":class/:id/:created_at/" to specify path uniqueness
Paperclip::Attachment.default_options[:path] = "#{AwesimRails.dataroot}/uploads/:class/:id/:created_at/:attachment/:filename"

# URL location points to file mount in routes called "/files"
# therefore this mirrors ':path' to some extent
Paperclip::Attachment.default_options[:url] = ":rails_relative_url_root/files/uploads/:class/:id/:created_at/:attachment/:filename"

# Necessary when rails app is hosted in subdirectory of domain
# e.g: http://www.example.com/rails1
Paperclip.interpolates :rails_relative_url_root do |attachment, style|
  Rails.application.config.action_controller.relative_url_root.to_s
end

# Necessary for path uniqueness when database is reset
Paperclip.interpolates :created_at do |attachment, style|
  attachment.instance.created_at.to_i
end

# Necessary to upload any file type
class Paperclip::MediaTypeSpoofDetector
  def spoofed?
    false
  end
end<commit_msg>update paperclip intializer for ood appkit<commit_after># http://robots.thoughtbot.com/prevent-spoofing-with-paperclip
# allow stl files to be uploaded
Paperclip.options[:content_type_mappings] = {
  :stl => "text/plain"
}

# We use ":class/:id/:created_at/" to specify path uniqueness
Paperclip::Attachment.default_options[:path] = "#{OodAppkit.dataroot}/uploads/:class/:id/:created_at/:attachment/:filename"

# URL location points to file mount in routes called "/files"
# therefore this mirrors ':path' to some extent
Paperclip::Attachment.default_options[:url] = ":rails_relative_url_root/files/uploads/:class/:id/:created_at/:attachment/:filename"

# Necessary when rails app is hosted in subdirectory of domain
# e.g: http://www.example.com/rails1
Paperclip.interpolates :rails_relative_url_root do |attachment, style|
  Rails.application.config.action_controller.relative_url_root.to_s
end

# Necessary for path uniqueness when database is reset
Paperclip.interpolates :created_at do |attachment, style|
  attachment.instance.created_at.to_i
end

# Necessary to upload any file type
class Paperclip::MediaTypeSpoofDetector
  def spoofed?
    false
  end
end
{'fraction_non_alphanumeric': 0.10691003911342895, 'fraction_numerical': 0.000869187309865276, 'mean_word_length': 5.892215568862276, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3495519', 'n_tokens_mistral': 747, 'n_tokens_neox': 731, 'n_words': 176}