Dylan Thacker-Smith

Results 149 comments of Dylan Thacker-Smith

IdentityCache's cache_has_many associations are meant to be used with relatively small bounded associations, since the result of loading the whole association is stored as a single cache blob. To integrate...

This is working as intended. > `irb(main):002:0> client.fetch_persons.map{|p| p.client.object_id}` You need to replace the `Person#client` call with `Person#fetch_client` if you want the cached record. Try this instead > `irb(main):002:0> client.fetch_persons.map{|p|...

Oh I see. It looks like cache_has_many with `embed: :ids` implements the `fetch_#{association}` method by just memoizing a [fetch_multi](https://github.com/Shopify/identity_cache/blob/c43c6faef989352f4a6ea4f0aee6211b0f2abb11/lib/identity_cache/configuration_dsl.rb#L230) on the associated class. Yes, it would make sense if the...

Yes, although you don't need both of those tests, since the only difference is that one tests the default value of the cache_has_many `embed` keyword argument.

Sure, I'll add a test for this. Also, I think we should probably use a higher log level for logging that the delete failed, since normally we wouldn't log at...

The first query only gets the id for the record, which often can be obtained from a [covering index](https://dev.mysql.com/doc/refman/8.0/en/glossary.html#glos_covering_index), so wouldn't even read from the primary/clustered index. It then checks...

> I don't have the full context, but it is my understanding we do not want to send the cache backend destructive request while within a transaction for fear of...

When a record is saved, `expire_cache` is the method called on it to expire the cache keys for it. That includes: * the primary index key for the record *...

If you are on the latest version of the code, then `MyModel.expire_primary_key_cache_index(my_id)` can be used.

Oh right, I meant to leave this open to remember to document this. Updated the title accordingly