    # File lib/active_record/validations.rb, line 63
          def generate_message(message, options = {})
            keys = @base.class.self_and_descendants_from_active_record.map do |klass|
              [ "models.#{klass.name.underscore}.attributes.#{attribute}.#{message}""models.#{klass.name.underscore}.attributes.#{attribute}.#{message}",
                "models.#{klass.name.underscore}.#{message}""models.#{klass.name.underscore}.#{message}" ]
            end.flatten

            keys << options.delete(:default)
            keys << "messages.#{message}""messages.#{message}"
            keys << message if message.is_a?(String)
            keys << @type unless @type == message
            keys.compact!

            options.reverse_merge! :default => keys,
                                   :scope => [:activerecord, :errors],
                                   :model => @base.class.human_name,
                                   :attribute => @base.class.human_attribute_name(attribute.to_s),
                                   :value => value

            I18n.translate(keys.shift, options)
          end