I have seen in paperclip gem has_attached_file :avatar.
How can I create a method like this for models?
My objective is whenever i define attribute like custom_method :attribute i can run some active operation the data of attribute on active record callbacks like save and delete.