<commit_before>class BproceBapp < ActiveRecord::Base
  include PublicActivity::Model
  tracked owner: Proc.new { |controller, model| controller.current_user }

  validates :bproce_id, :presence => true
  validates :bapp_id, :presence => true
  validates :apurpose, :presence => true

  belongs_to :bproce
  belongs_to :bapp

  attr_accessible :bproce_id, :bapp_id, :apurpose, :bproce_name, :bapp_name

  def bapp_name
    bapp.try(:designation)
  end

  def bapp_name=(name)
    self.bapp_id = Bapp.find_by_name(name).id if name.present?
  end

  def bproce_name
    bproce.try(:name)
  end

  def bproce_name=(name)
    self.bproce_id = Bproce.find_by_name(name).id if name.present?
  end

  def self.search(search)
    if search
      where('name ILIKE ? or description ILIKE ?', "%#{search}%", "%#{search}%")
    else
      where(nil)
    end
  end

end<commit_msg>fix: в attr_accessible добавлен id<commit_after>class BproceBapp < ActiveRecord::Base
  include PublicActivity::Model
  tracked owner: Proc.new { |controller, model| controller.current_user }

  validates :bproce_id, :presence => true
  validates :bapp_id, :presence => true
  validates :apurpose, :presence => true

  belongs_to :bproce
  belongs_to :bapp

  attr_accessible :id, :bproce_id, :bapp_id, :apurpose, :bproce_name, :bapp_name

  def bapp_name
    bapp.try(:designation)
  end

  def bapp_name=(name)
    self.bapp_id = Bapp.find_by_name(name).id if name.present?
  end

  def bproce_name
    bproce.try(:name)
  end

  def bproce_name=(name)
    self.bproce_id = Bproce.find_by_name(name).id if name.present?
  end

  def self.search(search)
    if search
      where('name ILIKE ? or description ILIKE ?', "%#{search}%", "%#{search}%")
    else
      where(nil)
    end
  end

end
{'fraction_non_alphanumeric': 0.11407491486946651, 'fraction_numerical': 0.0, 'mean_word_length': 3.8701657458563536, 'pattern_counts': {'":': 0, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5184104', 'n_tokens_mistral': 685, 'n_tokens_neox': 667, 'n_words': 146}