Skip to content

Commit

Permalink
[WIP] Method list dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffibm committed Feb 29, 2024
1 parent ccb776b commit e0cf6b9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/models/miq_ae_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@ class MiqAeMethod < ApplicationRecord
AVAILABLE_SCOPES = ["class", "instance"]
validates_inclusion_of :scope, :in => AVAILABLE_SCOPES

scope :name_path_search, ->(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 :selected_methods, ->(method_ids) {
if method_ids.present?
where(id: method_ids.split(',').map(&:to_i))
else
where(nil)
end
}

def self.available_languages
AVAILABLE_LANGUAGES
end
Expand Down

0 comments on commit e0cf6b9

Please sign in to comment.