<commit_before>class Project < ActiveRecord::Base

  belongs_to :creator, class_name: "User"
  has_many :project_tags
  has_many :tags, through: :project_tags
  has_many :collaborations
  has_many :collaborators, through: :collaborations, class_name: "User"

  validates :creator, presence: true
  validates :title, presence: true
  validates :description, presence: true
  validates :status, presence: true
  validates :skills_desired, presence: true

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

  def collaborators_with_status(status)
    User.joins(:collaborations)
    .select("collaborations.project_id, collaborations.status, users.*")
    .where("status='#{status}' AND project_id=#{self.id}")
  end

  def collaborations_with_status(status)
    Collaboration.where("status='#{status}' AND project_id=#{self.id}")
  end

end

<commit_msg>update query search in model<commit_after>class Project < ActiveRecord::Base

  belongs_to :creator, class_name: "User"
  has_many :project_tags
  has_many :tags, through: :project_tags
  has_many :collaborations
  has_many :collaborators, through: :collaborations, class_name: "User"

  validates :creator, presence: true
  validates :title, presence: true
  validates :description, presence: true
  validates :status, presence: true
  validates :skills_desired, presence: true

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

  def collaborators_with_status(status)
    User.joins(:collaborations)
    .select("collaborations.project_id, collaborations.status, users.*")
    .where("status='#{status}' AND project_id=#{self.id}")
  end

  def collaborations_with_status(status)
    collaborators.where(status: status)
  end

end


{'fraction_non_alphanumeric': 0.11246376811594203, 'fraction_numerical': 0.0, 'mean_word_length': 5.142348754448399, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3354233', 'n_tokens_mistral': 565, 'n_tokens_neox': 560, 'n_words': 133}