Changeset 174

Show
Ignore:
Timestamp:
07/23/08 12:29:54 (4 months ago)
Author:
pwh
Message:

Added %s around LIKE queries

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nethorus/app/controllers/search_controller.rb

    r140 r174  
    3535 
    3636      @devices = Device.find(:all, :conditions => [ "hostname LIKE :hostname", { :hostname => params[:for] } ]) 
    37       @l2_interfaces_short = L2Interface.find(:all, :conditions => [ "ifdescr_short LIKE :description", { :description => params[:for] } ]) 
    38       @l2_interfaces_long = L2Interface.find(:all, :conditions => [ "ifdescr_long LIKE :description", { :description => params[:for] } ]) 
    39       @l2_interfaces_address = L2Interface.find(:all, :conditions => [ "address LIKE :address", { :address => params[:for] } ]) 
     37      @l2_interfaces_short = L2Interface.find(:all, :conditions => [ "ifdescr_short LIKE :description", { :description => "%#params[:for]}%" } ]) 
     38      @l2_interfaces_long = L2Interface.find(:all, :conditions => [ "ifdescr_long LIKE :description", { :description => "%#{params[:for]}%" } ]) 
     39      @l2_interfaces_address = L2Interface.find(:all, :conditions => [ "address LIKE :address", { :address => "%#{params[:for]}%" } ]) 
    4040      @l3_interfaces_exact = L3Interface.find(:all, :conditions => [ "ipv4_address = :ipv4_address", { :ipv4_address => params[:for] } ]) 
    4141      @element_serial = EntPhysicalElement.find(:all, :conditions => [ "phys_serial_number = :serial_number", { :serial_number => params[:for] } ])