<commit_before>class Post < ActiveRecord::Base
  belongs_to :user
  has_attached_file :avatar, 
   :path =>"/avatars/:id/:style/:basename.:extension", :default_url => "/images/cat3.gif",
   :storage => :s3,
       :bucket => 'catsinyourhats',
       :s3_credentials => {
         :access_key_id => ENV['S3_KEY'],
         :secret_access_key => ENV['S3_SECRET']
       }
  
  def updatePost(@post)
   
    tmpfile=Tempfile.new('my_pic')<commit_msg>refactoring. putting update post code in model<commit_after>class Post < ActiveRecord::Base
  belongs_to :user
  has_attached_file :avatar, 
   :path =>"/avatars/:id/:style/:basename.:extension", :default_url => "/images/cat3.gif",
   :storage => :s3,
       :bucket => 'catsinyourhats',
       :s3_credentials => {
         :access_key_id => ENV['S3_KEY'],
         :secret_access_key => ENV['S3_SECRET']
       }
  
  def updatePost(post)
   
    tmpfile=Tempfile.new('my_pic')
{'fraction_non_alphanumeric': 0.15766738660907129, 'fraction_numerical': 0.01079913606911447, 'mean_word_length': 3.3317757009345796, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '3172378', 'n_tokens_mistral': 340, 'n_tokens_neox': 339, 'n_words': 51}