Advertisement
Guest User

Untitled

a guest
Jul 10th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.27 KB | None | 0 0
  1.   def self.check_field(name)
  2.     define_method(name) do
  3.       if object.privacy.include?(name.to_s)
  4.         false
  5.       else
  6.         super()
  7.       end
  8.     end
  9.   end
  10.  
  11.   check_field :first_name
  12.   check_field :last_name
  13.   check_field :email
  14.   check_field :birthday
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement