lib/pg_search/multisearch/rebuilder.rb in pg_search-1.0.2 vs lib/pg_search/multisearch/rebuilder.rb in pg_search-1.0.3
- old
+ new
@@ -61,15 +61,15 @@
end
end
def sti_clause
clause = ""
- if model.column_names.include? 'type'
+ if model.column_names.include? model.inheritance_column
clause = "WHERE"
if model.base_class == model
- clause = "#{clause} type IS NULL OR"
+ clause = "#{clause} #{model.inheritance_column} IS NULL OR"
end
- clause = "#{clause} type = #{model_name}"
+ clause = "#{clause} #{model.inheritance_column} = #{model_name}"
end
clause
end
def replacements