Patch Ancestry::InstanceMethods#ancestor_ids
Patch Ancestry::InstanceMethods#ancestor_ids

In many methods, this is generated twice because the result is never
saved.  This simply adds memoization to the result of this method.

Of Note:  The extra `#clear_memoized_instance_variables` additions were
necessary to fix failing tests due to ancestry records being updated and
saved, and the `@_ancestor_ids` value became out of date.

* * *

Before/After
------------

**Note:**  Only the totals here change... which is a bit weird and I
           didn't notice it before (probably just a reporting error on
           MemoryProfiler's end), but this patch was the only thing
           changed between the two runs.

Total allocated: 316196585 bytes (2917071 objects)   |   Total allocated: 307262021 bytes (2762757 objects)
                                  ^^^^^^^            |                                     ^^^^^^^
                                                     |
allocated objects by gem                             |   allocated objects by gem
-----------------------------------                  |   -----------------------------------
   1576834  activerecord-5.0.7                       |      1559102  activerecord-5.0.7
    477120  manageiq/app                             |       477120  manageiq/app
    274449  activemodel-5.0.7                        |       274449  activemodel-5.0.7
    208479  manageiq/lib                             |       106559  activesupport-5.0.7
    106557  activesupport-5.0.7                      |        82799  pending
     82799  pending                                  |        74117  ruby-2.3.3/lib
     74117  ruby-2.3.3/lib                           |        71895  manageiq/lib
     52875  manageiq-providers-vmware-0be2f13a0dc9   |        52875  manageiq-providers-vmware-0be2f13a0dc9
     35578  ancestry-2.2.2  <<<<<<<<<<               |        35578  ancestry-2.2.2  <<<<<<<<
     ...                                             |        ...

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