> Could you please explain me (of course if you know) how this code in the
> engine works.

So, I've learned how it works.

The save statement should be as follows:

@post = Post.new({:author_name => "some_name"}, :without_protection =>
true)
@post.save!

And a new author will be created if there is no user with such a name in
the DB. Otherwise the user will be updated.

This helped me:
http://stackoverflow.com/questions/3136420/difference-between-attr-accessor-and-attr-accessible

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/e3b3edc589323ee2234bcc7ae04c92bf%40ruby-forum.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to