rails/rails — pull request #12375 by arthurnn (2013-09-26 19:02:50+00:00)
Title: Inverse after find or initialize

### Problem
When calling `firm.clients_of_firm.find_or_initialize_by_client_of(id)`, and the id was found on the db, the inverse relation was not being set.
#### How so?
As `find_or_initialize_by_*` will only yield the block if the entry is new, the collection_proxy was never calling `add_to_target`, which make sense as the entry is on the target already, however the `set_inverse_instance` happen inside the add_to_target which in the case of a found entry was never happening.

### Solution
Always call `set_inverse_instance` after `find_or_instantiator_by_attributes`

review :green_heart: @rafaelfranca @carlosantoniodasilva

I am pretty much sure this is fixed on 4.0 as there is no method_missing thing anymore. (anyways I will double check and submit a patch to 4.0 if the issue happens in there.)