Skip to content

Commit

Permalink
Merge f1b710f into aace5dd
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzk committed Nov 29, 2018
2 parents aace5dd + f1b710f commit b63b620
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/forty_facets/filter/scope_filter_definition.rb
Expand Up @@ -2,7 +2,7 @@ module FortyFacets
class ScopeFilterDefinition < FilterDefinition
class ScopeFilter < Filter
def active?
definition.options[:pass_value] ? value.present? : '1'
definition.options[:pass_value] ? value.present? : value == '1'
end

def selected
Expand All @@ -28,7 +28,7 @@ def remove(value = nil)
search_instance.class.new_unwrapped(new_params, search_instance.root)
end

def add(value = nil)
def add(value = '1')
new_params = search_instance.params || {}
new_params[definition.request_param] = value
search_instance.class.new_unwrapped(new_params, search_instance.root)
Expand All @@ -38,7 +38,5 @@ def add(value = nil)
def build_filter(search_instance, value)
ScopeFilter.new(self, search_instance, value)
end

end
end

0 comments on commit b63b620

Please sign in to comment.