From d7b5716a0392b7127cfd029900f8e02008a78bf5 Mon Sep 17 00:00:00 2001 From: JEFFREY-Bonson Date: Fri, 1 Mar 2024 10:16:15 +0530 Subject: [PATCH] fix lint errors --- app/models/miq_ae_method.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/models/miq_ae_method.rb b/app/models/miq_ae_method.rb index 5cee1c59c18..21415314d4c 100644 --- a/app/models/miq_ae_method.rb +++ b/app/models/miq_ae_method.rb @@ -30,17 +30,17 @@ class MiqAeMethod < ApplicationRecord AVAILABLE_SCOPES = ["class", "instance"] validates_inclusion_of :scope, :in => AVAILABLE_SCOPES - scope :name_path_search, ->(search) { + scope :name_path_search, lambda { |search| where('name ILIKE ? or relative_path ILIKE ?', "%#{search}%", "%#{search}%") if search.present? } - - scope :domain_search, ->(domain_id) { - where('domain_id = ?', domain_id) if domain_id.present? + + scope :domain_search, lambda { |domain_id| + where(:domain_id => domain_id) if domain_id.present? } - - scope :selected_methods, ->(method_ids) { + + scope :selected_methods, lambda { |method_ids| if method_ids.present? - where(id: method_ids.split(',').map(&:to_i)) + where(:id => method_ids.split(',').map(&:to_i)) else where(nil) end