Revision e44f5c1c
Added by Daniel Lobato Garcia about 10 years ago
app/models/concerns/hostext/search.rb | ||
---|---|---|
extend ActiveSupport::Concern
|
||
|
||
included do
|
||
include ScopedSearchExtensions
|
||
|
||
has_many :search_parameters, :class_name => 'Parameter', :foreign_key => :reference_id
|
||
belongs_to :search_users, :class_name => 'User', :foreign_key => :owner_id
|
||
|
||
... | ... | |
end
|
||
conditions.empty? ? [] : "( #{conditions.join(' OR ')} )"
|
||
end
|
||
|
||
def value_to_sql(operator, value)
|
||
return value if operator !~ /LIKE/i
|
||
return value.tr_s('%*', '%') if (value =~ /%|\*/)
|
||
|
||
return "%#{value}%"
|
||
end
|
||
|
||
end
|
||
end
|
||
end
|
Also available in: Unified diff
fixes #3001 - Facts searchable by both host id and name