Class: Ecom::Core::EquipmentItem
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Ecom::Core::EquipmentItem
- Defined in:
- app/models/ecom/core/equipment_item.rb
Constant Summary collapse
- READY =
Equipment Statuses
'Ready'.freeze
- UNDER_MAINTENANCE =
'Under Maintenance'.freeze
- EQUIPMENT_STATUSES =
[READY, UNDER_MAINTENANCE].freeze
- AVAILABLE =
Duty Statuses
'Available'.freeze
- BOOKED =
'Booked'.freeze
- ON_DUTY =
'On Duty'.freeze
- DUTY_STATUSES =
[AVAILABLE, BOOKED, ON_DUTY].freeze
Class Method Summary collapse
Class Method Details
.search(param) ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'app/models/ecom/core/equipment_item.rb', line 26 def self.search(param) search_term = "%#{param.downcase}%" Ecom::Core::EquipmentItem .joins(:equipment) .where( 'lower(ecom_core_equipment_items.name) LIKE ? OR lower(ecom_core_equipment.name) LIKE ?', search_term, search_term ) end |