<commit_before>require 'active_support/concern'

module WithLanguage
  extend ActiveSupport::Concern

  included do
    scope :with_language, -> (language) {
      if language
        where(
          "languages @> ARRAY[:language] AND language = :language
          OR NOT languages @> ARRAY[:language] AND is_default_language",
          language: language
        )
      else
        where(is_default_language: true)
      end
    }
  end
end<commit_msg>Fix issue with referencing correct language column<commit_after>require 'active_support/concern'

module WithLanguage
  extend ActiveSupport::Concern

  included do
    scope :with_language, -> (language) {
      if language
        where(
          "languages @> ARRAY[:language] AND #{self.table_name}.language = :language
          OR NOT languages @> ARRAY[:language] AND is_default_language",
          language: language
        )
      else
        where(is_default_language: true)
      end
    }
  end
end
{'fraction_non_alphanumeric': 0.08127572016460906, 'fraction_numerical': 0.0, 'mean_word_length': 2.644194756554307, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5919511', 'n_tokens_mistral': 269, 'n_tokens_neox': 263, 'n_words': 71}