Skip to content

Commit

Permalink
handle rt and plain indices the same
Browse files Browse the repository at this point in the history
  • Loading branch information
akostadinov committed Aug 9, 2023
1 parent 13d0db2 commit 013ac49
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/thinking_sphinx/configuration/minimum_fields.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ def reconcile
attr_reader :indices

def field_collections
plain_indices_without_inheritance.collect(&:sources).flatten +
indices_of_type('rt')
end

def indices_of_type(type)
indices.select { |index| index.type == type }
indices_without_inheritance_of_type('plain').collect(&:sources).flatten +
indices_without_inheritance_of_type('rt')
end

def inheritance_columns?(index)
index.model.table_exists? && index.model.column_names.include?(index.model.inheritance_column)
end

def plain_indices_without_inheritance
indices_of_type('plain').reject(&method(:inheritance_columns?))
def indices_without_inheritance_of_type(type)
indices_without_inheritance.select { |index| index.type == type }
end

def indices_without_inheritance
indices.reject(&method(:inheritance_columns?))
end
end

0 comments on commit 013ac49

Please sign in to comment.