Sha256: a504a3b8e697929a3dae10e4a0c3bc2c3044f19c11195953a6fc94f85f9a4021
Contents?: true
Size: 594 Bytes
Versions: 81
Compression:
Stored size: 594 Bytes
Contents
module Ecom module Core class Equipment < ApplicationRecord belongs_to :equipment_category validates :name, :minimum_acquisition_time, presence: true validates :name, uniqueness: { scope: :equipment_category_id } def self.search(param) search_term = "%#{param.downcase}%" Ecom::Core::Equipment .joins(:equipment_category) .where( 'lower(ecom_core_equipment.name) LIKE ? OR lower(ecom_core_equipment_categories.name) LIKE ?', search_term, search_term ) end end end end
Version data entries
81 entries across 81 versions & 1 rubygems