How can I save a related model within a constructor. For example:
public class Magazine extends Model {
public Magazine() {
new Subscription(this, user); // automatically make the owner subscribe
to the magazine
}
}
public class Subscription extends Model {
public Subscription(Magazine magazine, User user) {
this.magazine = magazine;
this.user = user;
}
}
Magazine m = new Magazine();
======
When I create a new Magazine object and save it, it doesn't save the
Subscription model. Is there anything I am doing wrong here?