Association scope should work when a nil value is returned.

### Problem
We have some associations that need to associate 2 fks, when the record exists.
```ruby
  has_one :transfer, -> (record) {
      where(shop_id: record.shop_id)  if record
  }, foreign_key: 'transfer_id', primary_key: 'transfer_id'
```

So when the `record` is nil, we will return a nil object to the proc. We should be able to deal with that easily just short-circuiting it.

review @carlosantoniodasilva @tenderlove