Class: Business
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Business
- Defined in:
- app/models/business.rb
Overview
Class Method Summary (collapse)
Class Method Details
+ (Object) search(business_search_form)
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/models/business.rb', line 17 def self.search business_search_form if business_search_form.valid? where( 'name ILIKE :name AND location ILIKE :location AND business_type ILIKE :business_type', name: "%#{ business_search_form.name }%", location: "%#{ business_search_form.location }%", business_type: "%#{ business_search_form.business_type }%" ) else none end end |