<commit_before>class Question < ActiveRecord::Base
  belongs_to :user
  has_many :answers
  has_many :tags
  has_many :comments, as: :commentable
  has_many :votes, as: :votable

  validates_presence_of :body
  validates_presence_of :title
  validates_presence_of :user_id


  def vote_count
    self.votes.where(upvote: true).count - self.votes.where(upvote: false).count
  end

  def create_tags(string)
    string.split(',').each{ |tag| self.tags.create(name: tag)}
  end

  def self.search(words)
    matches = []
    words.split(' ').each do |word|
      matches << Question.all.select { |q| q.title.include?(word) || q.body.include?(word) }
    end
    matches.flatten.uniq
  end
end<commit_msg>Models: created display_tags method<commit_after>class Question < ActiveRecord::Base
  belongs_to :user
  has_many :answers
  has_many :tags
  has_many :comments, as: :commentable
  has_many :votes, as: :votable

  validates_presence_of :body
  validates_presence_of :title
  validates_presence_of :user_id


  def vote_count
    self.votes.where(upvote: true).count - self.votes.where(upvote: false).count
  end

  def create_tags(string)
    string.split(',').each{ |tag| self.tags.create(name: tag)}
  end

  def display_tags
    self.tags.map{ |tag| tag.name}.join(',')
  end

  def self.search(words)
    matches = []
    words.split(' ').each do |word|
      matches << Question.all.select { |q| q.title.include?(word) || q.body.include?(word) }
    end
    matches.flatten.uniq
  end
end
{'fraction_non_alphanumeric': 0.12575250836120402, 'fraction_numerical': 0.0, 'mean_word_length': 3.779552715654952, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, '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': '3061976', 'n_tokens_mistral': 544, 'n_tokens_neox': 536, 'n_words': 114}