Sha256: 7a14933e592f0a7f85011e4af28e86b693acf3bcdd06eae0c0d877c9e109a6e8

Contents?: true

Size: 930 Bytes

Versions: 152

Compression:

Stored size: 930 Bytes

Contents

module Katello
  module Concerns
    module SearchByRepositoryName
      extend ActiveSupport::Concern
      include ScopedSearchExtensions

      included do
        has_many :root_repositories, through: :repositories, :source => :root, class_name: "Katello::RootRepository"
        scoped_search :relation => :root_repositories, :on => :name, :rename => :repository,
                      :complete_value => true,
                      :ext_method => :search_by_repo_name, :only_explicit => true
      end

      module ClassMethods
        def search_by_repo_name(_key, operator, value)
          conditions = sanitize_sql_for_conditions(["#{Katello::RootRepository.table_name}.name #{operator} ?", value_to_sql(operator, value)])
          query = self.joins(:repositories => :root).where(conditions).select('id')
          {:conditions => "#{self.table_name}.id IN (#{query.to_sql})"}
        end
      end
    end
  end
end

Version data entries

152 entries across 152 versions & 1 rubygems

Version Path
katello-4.14.2 app/models/katello/concerns/search_by_repository_name.rb
katello-4.15.0 app/models/katello/concerns/search_by_repository_name.rb
katello-4.15.0.rc2 app/models/katello/concerns/search_by_repository_name.rb
katello-4.15.0.rc1 app/models/katello/concerns/search_by_repository_name.rb
katello-4.14.1 app/models/katello/concerns/search_by_repository_name.rb
katello-4.14.0 app/models/katello/concerns/search_by_repository_name.rb
katello-4.14.0.rc3 app/models/katello/concerns/search_by_repository_name.rb
katello-4.14.0.rc2 app/models/katello/concerns/search_by_repository_name.rb
katello-4.14.0.rc1.1 app/models/katello/concerns/search_by_repository_name.rb
katello-4.14.0.rc1 app/models/katello/concerns/search_by_repository_name.rb
katello-4.13.1 app/models/katello/concerns/search_by_repository_name.rb
katello-4.13.0 app/models/katello/concerns/search_by_repository_name.rb
katello-4.12.1 app/models/katello/concerns/search_by_repository_name.rb
katello-4.13.0.rc1 app/models/katello/concerns/search_by_repository_name.rb
katello-4.12.0 app/models/katello/concerns/search_by_repository_name.rb
katello-4.12.0.rc3 app/models/katello/concerns/search_by_repository_name.rb
katello-4.12.0.rc2 app/models/katello/concerns/search_by_repository_name.rb
katello-4.12.0.rc1 app/models/katello/concerns/search_by_repository_name.rb
katello-4.11.1 app/models/katello/concerns/search_by_repository_name.rb
katello-4.11.0 app/models/katello/concerns/search_by_repository_name.rb