Class: Ecom::Core::Equipment
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Ecom::Core::Equipment
- Defined in:
- app/models/ecom/core/equipment.rb
Class Method Summary collapse
Class Method Details
.search(param) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'app/models/ecom/core/equipment.rb', line 9 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 |