Guest User

Untitled

a guest
May 20th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. # show all zipcodes from all ziplocations that belong to a user in a single array ["11111", "22222"]
  2. def services_zipcode(zip)
  3. self.ziplocations.collect{|zl| zl.zipcodes}.flatten.uniq.compact.collect{|zc| zc.zip}.include?(zip)
  4. end
Add Comment
Please, Sign In to add comment