Move has_attached_file in pin.rb to fix crash