See: https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md#lazy-attributes
I believe can achieve the same effect by using sequence and simply ignoring the index parameter i:
#import <Defactory/Defactory.h>
#import "MyModel.h"
FACTORIES(^{
[MyModel defineFactory:^(LSFactory *f) {
f[@"createdAt"] = sequence(^(NSUInteger i) { return [NSDate date]; });
}];
});
Is this "correct"? How would you feel about adding a lazy function for this specific purpose? Something like:
f[@"createdAt"] = lazy(^{ return [NSDate date]; });