On Apr 9, 4:23 am, Marian Steinbach <[email protected]>
wrote:
> My model is like this:
>
> SearchSubscrtipion belongs_to User
> User has_many SearchSubscriptions
>
> In the SearchSubscription model I had a before_create callback that
> was trying to create the new user record if not yet available. (Thus
> creating it's own parent on the fly.) Seems as if that's impossible.
>
> I will try as you stated, without the before_create callback.

Right, so create the User first, then create a new SearchSubscription
that belongs to the user. You might be better off having the users
created independently, that is, not attached to the idea of
"dynamically generate the user whenever they want to do a search". But
rather, "Anonymous User wants to save a search, so they are redirected
to the signup screen.'

Ho-Sheng Hsiao
http://hosheng.blogspot.com

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to