<commit_before>require 'mime/types'
class Photo < ActiveRecord::Base
  has_attached_file :photo,
#    :path => ":rails_root/public/system/:attachment/:id.:extension", ## attachementがphoto, idが勝手につく
#    :url => "/system/:attachment/:id.:extension",
	:styles => {
	   :large => "800x800>", 
       :thumb=> "100x100#",
       :small  => "400x400>" }
	validates_attachment_presence :photo 
	validates_attachment_size :photo, :less_than => 2.megabytes  
#	validates_attachment_content_type :photo, :content_type => ['image/jpeg', 'image/jpg', 'image/png', 'image/gif'] ## うまく動かない

  def uploaded_file=(file_data)
    file_data.content_type = MIME::Types.type_for(file_data.original_filename).to_s
    self.photo = file_data
  end
end
<commit_msg>fix path<commit_after>require 'mime/types'
class Photo < ActiveRecord::Base
  has_attached_file :photo,
	:styles => {
	   :large => "800x800>", 
       :thumb=> "100x100#",
       :small  => "400x400>" },
    :url => "/system/pict_share/album_id/:attachment/:id/:style/:basename.:extension",
    :path => ":rails_root/public/system/pict_share/album_id/:attachment/:id/:style/:basename.:extension" ## attachementがphoto, idが勝手につく
	validates_attachment_presence :photo
#	validates_attachment_size :photo, :less_than => 2.megabytes  
#	validates_attachment_content_type :photo, :content_type => ['image/jpeg', 'image/jpg', 'image/png', 'image/gif'] ## うまく動かない

  def uploaded_file=(file_data)
    file_data.content_type = MIME::Types.type_for(file_data.original_filename).to_s
    self.photo = file_data
  end
end

{'fraction_non_alphanumeric': 0.15518351577591757, 'fraction_numerical': 0.02446877012234385, 'mean_word_length': 4.954022988505747, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 23, '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': '5788561', 'n_tokens_mistral': 590, 'n_tokens_neox': 558, 'n_words': 85}