def validates_attached_presence(name, options = {})

      message = options[:message] || "must be attached"

      validates_presence_of :"#{name}_identifier", message: message,
        if: options[:if], unless: options[:unless]

    end
def validates_attached_presence(name, options = {})

      message = options[:message] || "must be attached"

      validates_presence_of :"#{name}_identifier", message: message,
        if: options[:if], unless: options[:unless]

    end
Validates that an attachment is included.

 Options:

 * :message - string to be displayed

 Usage:

   validates_attached_presence :avatar
   validates_attached_presence :avatar, message: "must be attached"