First SO question after using this place for reference on many other things .. I'm nervous.
DataMapper .. Using a Blog model for example (posts, comments, etc. - http://datamapper.org/docs/associations.html ) I'm trying to train how to get blog posts that have no comments ..
So something like Post.all (: comments => {: comment => nil})
Lot has a lot of luck: (
I read here that for complex reporting queries it is best to flush SQL, but of course the way to do this is not so. SO?
Thanks in advance.
Post (, "comments_count" ), . :
Post.find(:all, :include => :comments).select { |post| post.comments.empty? }
( ):
Post.all(:conditions => { :comments_count => 0 })
, Rails 3 ( ).
Source: https://habr.com/ru/post/1732255/More articles:XNA Game Studio 3.1 and Zune HD (how to render a 3D texture / model) - c #Multiple django applications in python path or in project - gitProblems / Steps to downgrade silverlight 4 to silverlight 3 - silverlightSecurity in the Grails-app: Acegi or Shiro - authenticationWCF: Is it safe to create an asynchronous workflow on the server? - asynchronousCommunication Error Message - coldfusionкак получить значение отношения в form_builder в rails - ruby-on-railsUse sorting while still holding keys - sortingProblem Posting a MIME-encoded application to the Ariba vendor network - postAnnounce which signals subscribe to DBus? - pythonAll Articles