Class: Deli::Adapters::ActiveRecord::String

Inherits:
Param
  • Object
show all
Includes:
Param::String
Defined in:
lib/deli/adapters/active_record.rb

Instance Attribute Summary

Attributes inherited from Param

#table_key

Attributes inherited from Param

#controller, #default, #exact, #key, #model_name, #namespace

Instance Method Summary (collapse)

Methods included from Param::String

#parse

Methods inherited from Param

#configure_clauses, #find_association, #initialize, #match_operator, #operators, #parenthesize!, #parse, #postgres?, #render, #render_name, #render_operator

Methods inherited from Param

#initialize, #inspect, #parse, #parse_value, #render

Constructor Details

This class inherits a constructor from Deli::Adapters::ActiveRecord::Param

Instance Method Details

- (Object) render_value(value, operator = nil)



214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/deli/adapters/active_record.rb', line 214

def render_value(value, operator = nil)
  case operator
  when "=", "!="
    value
  when "^"
    "%#{value}"
  when "$"
    "#{value}%"
  else
    "%#{value}%"
  end
end