<commit_before>class Ticket < ActiveRecord::Base
  belongs_to :client
  belongs_to :project
  belongs_to :priority
  belongs_to :user
  has_many   :comments
  has_many   :receipts  
  
  def self.current_project(project_id)
    where('project_id = ?', project_id)
  end
  
  def self.updates(stamp)
    # Grab all updates and append system time to push to the fron end
    select('client_id, user_id').where('updated_at >= ?', stamp).all << Time.now.utc.strftime('%Y-%m-%d %H:%M:%S')
  end
  
  def self.createTickets(project)
    clients = Client.house
    clients.each do |c|
       c.tickets.create(:project_id => project.id, :priority_id => (Priority.retrieve(c,project)))
    end
  end

  # Returns true or false depending on whether a student is able to add another client
  def self.more_clients_allowed(user, project)
    current_tickets = user.tickets.where('project_id = ? AND id IN (?)',
                                          project.id, Receipt.where('user_id = ? AND made_sale = ?',<commit_msg>updates now properly returns the ticket id<commit_after>class Ticket < ActiveRecord::Base
  belongs_to :client
  belongs_to :project
  belongs_to :priority
  belongs_to :user
  has_many   :comments
  has_many   :receipts  
  
  def self.current_project(project_id)
    where('project_id = ?', project_id)
  end
  
  def self.updates(stamp)
    # Grab all updates and append system time to push to the fron end
    select('id, client_id, user_id').where('updated_at >= ?', stamp).all << Time.now.utc.strftime('%Y-%m-%d %H:%M:%S')
  end
  
  def self.createTickets(project)
    clients = Client.house
    clients.each do |c|
       c.tickets.create(:project_id => project.id, :priority_id => (Priority.retrieve(c,project)))
    end
  end

  # Returns true or false depending on whether a student is able to add another client
  def self.more_clients_allowed(user, project)
    current_tickets = user.tickets.where('project_id = ? AND id IN (?)',
                                          project.id, Receipt.where('user_id = ? AND made_sale = ?',
{'fraction_non_alphanumeric': 0.11143552311435523, 'fraction_numerical': 0.0, 'mean_word_length': 3.195918367346939, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2055686', 'n_tokens_mistral': 666, 'n_tokens_neox': 667, 'n_words': 169}