<commit_before>class Programme < ActiveRecord::Base
  attr_accessible :avatar_id, :description, :first_letter, :title, :uuid, :web_page, :project_ids, :funding_details

  acts_as_yellow_pages

  #associations
  has_many :projects
  accepts_nested_attributes_for :projects

  #validations
  validates :title,:uniqueness=>true

  scope :default_order, order('title')


  searchable(:auto_index=>false) do
    text :title,:description
    text :projects do
      projects.compact.map(&:title)
    end
    text :institutions do
      institutions.compact.map(&:title)
    end
  end if Seek::Config.solr_enabled

  def people
    projects.collect{|p| p.people}.flatten.uniq
  end

  def institutions
    projects.collect{|p| p.institutions}.flatten.uniq
  end

  def can_be_edited_by?(user)
    !user.nil? && user.is_admin?
  end


end

<commit_msg>include funding details in search<commit_after>class Programme < ActiveRecord::Base
  attr_accessible :avatar_id, :description, :first_letter, :title, :uuid, :web_page, :project_ids, :funding_details

  acts_as_yellow_pages

  #associations
  has_many :projects
  accepts_nested_attributes_for :projects

  #validations
  validates :title,:uniqueness=>true

  scope :default_order, order('title')


  searchable(:auto_index=>false) do
    text :title,:description, :funding_details
    text :projects do
      projects.compact.map(&:title)
    end
    text :institutions do
      institutions.compact.map(&:title)
    end
  end if Seek::Config.solr_enabled

  def people
    projects.collect{|p| p.people}.flatten.uniq
  end

  def institutions
    projects.collect{|p| p.institutions}.flatten.uniq
  end

  def can_be_edited_by?(user)
    !user.nil? && user.is_admin?
  end


end


{'fraction_non_alphanumeric': 0.10196987253765932, 'fraction_numerical': 0.0, 'mean_word_length': 4.233333333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3674626', 'n_tokens_mistral': 601, 'n_tokens_neox': 571, 'n_words': 119}