Project

General

Profile

« Previous | Next » 

Revision 428b1cfb

Added by Joseph Magen about 10 years ago

fixes #5506 - added scoped search to SmartProxy for UI and API v2

View differences:

app/models/smart_proxy.rb
before_save :sanitize_url, :associate_features
scoped_search :on => :name, :complete_value => :true
scoped_search :on => :url, :complete_value => :true
scoped_search :in => :features, :on => :name, :rename => :feature, :complete_value => :true
# with proc support, default_scope can no longer be chained
# include all default scoping here
......
where(:features => { :name => v }).joins(:features)
}
end
scope :with_features, lambda {|*feature_names| where(:features => { :name => feature_names }).joins(:features) }
scope :with_features, lambda {|*feature_names| where(:features => { :name => feature_names }).joins(:features) if feature_names.any? }
def hostname
# This will always match as it is validated

Also available in: Unified diff