<commit_before># CRUD Controller (inherited resources controller)
#
# This is the base for CRUD resources controller, only add code that really
# needs to be included in every inherited_resources controller.
class CrudController < InheritedResources::Base
  # Authorization
  load_and_authorize_resource

  # Responders
  respond_to :html, :js

  # Apply index pagination by default
  has_scope :page, default: 1, only: [ :index ]
  has_scope :per, default: Kaminari.config.default_per_page, only: [ :index ]

  # Search
  has_scope :by_text, if: -> (_) { resource_class.respond_to? :by_text}
end
<commit_msg>fix(crud): proper check if by_text is available on model<commit_after># CRUD Controller (inherited resources controller)
#
# This is the base for CRUD resources controller, only add code that really
# needs to be included in every inherited_resources controller.
class CrudController < InheritedResources::Base
  # Authorization
  load_and_authorize_resource

  # Responders
  respond_to :html, :js

  # Apply index pagination by default
  has_scope :page, default: 1, only: [ :index ]
  has_scope :per, default: Kaminari.config.default_per_page, only: [ :index ]

  # Search
  has_scope :by_text
end

{'fraction_non_alphanumeric': 0.07768595041322314, 'fraction_numerical': 0.001652892561983471, 'mean_word_length': 4.9655172413793105, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '2743979', 'n_tokens_mistral': 371, 'n_tokens_neox': 360, 'n_words': 125}