def foreign_key(name)
      attr = schema.foreign_key(name.dataset)

      if attr
        attr.name
      else
        :"#{Inflector.singularize(name.dataset)}_id"
      end
    end
def foreign_key(name)
      attr = schema.foreign_key(name.dataset)

      if attr
        attr.name
      else
        :"#{Inflector.singularize(name.dataset)}_id"
      end
    end
Return a foreign key name for the provided relation name

 @param [Name] name The relation name object

 @return [Symbol]

 @api private