Port of attachment_fu for modern rails projects. Originally from pothoven, modified by sikanrong.