I fixed bug in MoCo and added keys accessor.

jkondo on 2007-02-04T01:31:45

I uploaded MoCo ver 0.05 today. I fixed a bug that cached objects are not flushed correctly when they're stored without primary keys. I added keys accessor to MoCo and changed flush mechanism.

If you define Entry.pm like this,

package Entry; __PACKAGE__->primary_keys(['entry_id']); __PACKAGE__->keys(['uri']);

and, retrieve an entry from uri,

my $e = Entry->retrieve_by_uri('http://123');

and, create a new entry.

my $e2 = Entry->create(uri => 'http://123');

The first cache, $e is flushed correctly.

(I'm still considering about the name.)