lib/sn_foil/searcher.rb in snfoil-0.1.0 vs lib/sn_foil/searcher.rb in snfoil-0.3.0
- old
+ new
@@ -1,19 +1,13 @@
# frozen_string_literal: true
require 'active_support/concern'
-require 'active_support/core_ext/module/attribute_accessors'
module SnFoil
module Searcher
extend ActiveSupport::Concern
- included do
- TRUECAST = 'true'
- FALSECAST = 'false'
- end
-
class_methods do
attr_reader :i_model, :i_setup, :i_filters, :i_search_step
def model(klass = nil)
@i_model = klass
@@ -94,12 +88,12 @@
true
end
def transform_params_booleans(params)
params.map do |key, value|
- value = if value == TRUECAST
+ value = if value == 'true'
true
- elsif value == FALSECAST
+ elsif value == 'false'
false
else
value
end
[key, value]