Guest User

Untitled

a guest
Apr 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. class Prop < ActiveRecord::Base
  2. #Validates fields for data entered by user when submitted
  3. validates_presence_of :title, :category, :availability, :keywords, :description, :price
  4. validates_numericality_of :price, :on => :save
  5. validates_numericality_of :year, :on => :create
  6.  
  7. def list_by(field, item)
  8. self.find(:one, :params => { field => item })
  9. end
  10. end
Add Comment
Please, Sign In to add comment