Advertisement
Guest User

Untitled

a guest
Feb 24th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.17 KB | None | 0 0
  1. class Contato < ApplicationRecord
  2.   validates_presence_of:nome
  3.   validates_presence_of:telefone
  4.   def self.search(query)
  5.         where("nome LIKE :q", :q => "%#{query}%")
  6.     end
  7. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement