lib/pg_search/multisearch/rebuilder.rb in pg_search-2.1.1 vs lib/pg_search/multisearch/rebuilder.rb in pg_search-2.1.2
- old
+ new
@@ -1,12 +1,10 @@
module PgSearch
module Multisearch
class Rebuilder
def initialize(model, time_source = Time.method(:now))
- unless model.respond_to?(:pg_search_multisearchable_options)
- raise ModelNotMultisearchable.new(model)
- end
+ raise ModelNotMultisearchable.new(model) unless model.respond_to?(:pg_search_multisearchable_options)
@model = model
@time_source = time_source
end
@@ -63,12 +61,10 @@
def sti_clause
clause = ""
if model.column_names.include? model.inheritance_column
clause = "WHERE"
- if model.base_class == model
- clause = "#{clause} #{model.inheritance_column} IS NULL OR"
- end
+ clause = "#{clause} #{model.inheritance_column} IS NULL OR" if model.base_class == model
clause = "#{clause} #{model.inheritance_column} = #{model_name}"
end
clause
end