Sha256: 71604fdf0c110d050b4d591a70a233699b6e91ab31793cf5ed3f1af097f60aaf
Contents?: true
Size: 648 Bytes
Versions: 19
Compression:
Stored size: 648 Bytes
Contents
module Provisioning extend ActiveSupport::Concern included do scoped_search on: :name, complete_value: { true: true, false: false }, rename: 'supported', ext_method: :search_by_supported def self.search_by_supported(_key, operator, value) value = value == 'true' value = !value if operator == '<>' op = value ? 'IN' : 'NOT IN' names = ProvisioningTemplatesControllerBranding::SUPPORTED_PROVISIONING_TEMPLATES.map do |n| "'#{n}'" end.join(',') conditions = "templates.name #{op} (#{names})" { conditions: sanitize_sql_for_conditions([conditions]) } end end end
Version data entries
19 entries across 19 versions & 1 rubygems