Add has_one scope support to virtual_delegate
Add has_one scope support to virtual_delegate

This enhances virtual_delegates so that scopes added as part of a
`has_one` relation are respected.

Because of the changes, an implicit `limit = 1` was necessary to support
the `has_one`, and the easiest way to accomplish that while still
keeping `select_from_alias` in a similar form was to allow passing a
block so the arel (prior to being converted to a string) could be
updated.

Also of note, `select_from_alias` also had a few changes to it beyond
that:

  - The "query" is now built up from the scope on the model, not a raw
    arel_table from the to_ref model.
  - Instead of a `project`, we call a `.select` on the "query" (scope
    from the relation), which already has a similar arg structure, but
    allows us to remove the select_values properly before converting it
    to arel (happens right after the `.select`).  We work with raw
    `Arel` after that.
  - The `table_alias` functionality is now done through the `from`
    clause, `from(to_table)` allows us to still keep the same alias
    functionality we had.  Under the covers, this does the same thing,
    it is just previously the starting point was an `Arel::Table`, and
    now it is a `Arel::SelectManager`.  The `Arel::Table` version ends
    up returning a `SelectManager` anyway, so what we are doing is
    functionally equivalent.

juliancheal/manageiq,tinaafitz/manageiq,kbrock/manageiq,jrafanie/manageiq,d-m-u/manageiq,NickLaMuro/manageiq,jameswnl/manageiq,jameswnl/manageiq,mkanoor/manageiq,syncrou/manageiq,lpichler/manageiq,mzazrivec/manageiq,jvlcek/manageiq,d-m-u/manageiq,branic/manageiq,djberg96/manageiq,chessbyte/manageiq,djberg96/manageiq,kbrock/manageiq,NickLaMuro/manageiq,skateman/manageiq,romanblanco/manageiq,andyvesel/manageiq,lpichler/manageiq,yaacov/manageiq,chessbyte/manageiq,skateman/manageiq,mkanoor/manageiq,branic/manageiq,billfitzgerald0120/manageiq,yaacov/manageiq,pkomanek/manageiq,jvlcek/manageiq,gmcculloug/manageiq,yaacov/manageiq,gmcculloug/manageiq,tinaafitz/manageiq,syncrou/manageiq,ManageIQ/manageiq,chessbyte/manageiq,jrafanie/manageiq,kbrock/manageiq,mkanoor/manageiq,aufi/manageiq,aufi/manageiq,juliancheal/manageiq,pkomanek/manageiq,ManageIQ/manageiq,gmcculloug/manageiq,romanblanco/manageiq,djberg96/manageiq,yaacov/manageiq,NickLaMuro/manageiq,skateman/manageiq,aufi/manageiq,lpichler/manageiq,pkomanek/manageiq,borod108/manageiq,skateman/manageiq,agrare/manageiq,ManageIQ/manageiq,andyvesel/manageiq,kbrock/manageiq,chessbyte/manageiq,billfitzgerald0120/manageiq,hstastna/manageiq,agrare/manageiq,borod108/manageiq,branic/manageiq,hstastna/manageiq,tinaafitz/manageiq,agrare/manageiq,tinaafitz/manageiq,billfitzgerald0120/manageiq,romanblanco/manageiq,mzazrivec/manageiq,andyvesel/manageiq,syncrou/manageiq,ManageIQ/manageiq,lpichler/manageiq,aufi/manageiq,mzazrivec/manageiq,pkomanek/manageiq,syncrou/manageiq,jameswnl/manageiq,agrare/manageiq,djberg96/manageiq,jrafanie/manageiq,juliancheal/manageiq,billfitzgerald0120/manageiq,mzazrivec/manageiq,hstastna/manageiq,branic/manageiq,borod108/manageiq,jameswnl/manageiq,romanblanco/manageiq,d-m-u/manageiq,hstastna/manageiq,borod108/manageiq,gmcculloug/manageiq,jvlcek/manageiq,jvlcek/manageiq,mkanoor/manageiq,d-m-u/manageiq,andyvesel/manageiq,NickLaMuro/manageiq,juliancheal/manageiq,jrafanie/manageiq