Closed ghost closed 11 years ago
Hm... Good question, I don't know why, but this feature is not implemented. But seems that implementation is very easy. For example:
@interface User : ActiveRecord
- (Project *)project;
@end
@implementation User
- (Project *)project
{
return [[[Project lazyFetcher] where:@"user.id = %@", self.id] firstObject];
}
@end
setProject
may looks very similar.
What about the Destroy Dependency?
The same as setProject
, find record and remove it manually.
OK I found a way to do it.
Thanks for the help and I'm really waiting to see the new version!
P.S. The fetcher should be [where:@"'project'.'userId' = %@", self.id]
(doesn't work otherwise)
Have a good day! :wink:
Yep, you're right!
Thank you :smile:
I haven't found a way to do the 'has_one' relationship between two models. Is that possible? Thanks for any help.