Sha256: 8e7903e8ec8163bb5503411862600af883715f9ac11c807adc1b8e7ec621a0b3
Contents?: true
Size: 476 Bytes
Versions: 38
Compression:
Stored size: 476 Bytes
Contents
# require "eitil_core/application_record/find_by_like" # require "eitil_core/railtie" to run the dynamic dispatch as an init hook during boot require "eitil_core/railtie" module EitilCore module ApplicationRecord module FindByLike Eitil::ApplicationRecordModules << self def find_by_like(_hash) column, like = _hash.first find_by("REPLACE(LOWER(#{column}), ' ', '') LIKE ?", "%#{like.downcase.delete(' ')}%") end end end end
Version data entries
38 entries across 38 versions & 1 rubygems