Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 16th, 2018 75 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #
  2. # In your model, you'll want these scopes, so this query logic can be reused elsewhere
  3. #
  4.  
  5. scope :with_make, ->(make) { where(make: make) if make }
  6. scope :from_year, ->(min_year) { where('year >= ?', min_year) if min_year }
  7. scope :until_year, ->(max_year) { where('year <= ?', max_year) if max_year }
  8. scope :above_price, ->(min_selling_price) { where('selling_price >= ?', min_selling_price) if min_selling_price }
  9. scope :below_price, ->(max_selling_price) { where('selling_price <= ?', max_selling_price) if max_selling_price }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top