Hi, Using Ruby on Rails, let's says I have an Article model and Comment model. An Article has_many :comments,
Using Rais idiom, one would do something like that in the comments_controller/create: @article = Article.find(params[:id]) @article.comments.create(params[:comment]) I don't like too much this approach because it puts too much intelligence into the controller and it's not easy to test/spec/mock. So I'd like to push this into a model. So would you tell Article model to create a new Comment given params[:comment], or would you tell Comment to create a new Comment given an article_id? >From a BDD point of view, only creating a new comment record is what counts, but I'd like to be more careful about Demeter, encapsulation, tell don't ask, ... -- Posted via http://www.ruby-forum.com/. _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users