So I am working on this project but I am having trouble with a find
statement. My code is mostly working but it falls apart when more
entries are added.

I am working on a submission manager. I want a table of submissions
for editors of a specific genre for which they haven't commented. When
they comment I want it removed from table so that only the submissions
they need to work on are showing. I tried two methods that produce the
same results. One I used a find statement and another I tried a named
scope. Right now I can filter out the submissions of the specific
genre and then remove ones that have been commented on but soon as a
second editor comments on them they show up again.

Here is my code for the named scope

(In the submission model)

 named_scope :not_commented_by, lambda { |u| { :include
=> :comments, :conditions => ['comments.editor_id != ? OR comments.id
IS NULL', u.id] } }

(In the User Controller)

@prose = Genre.find_by_name('Prose').submissions.not_commented_by
(@user)

Here is my code for the find statement

(In the user controller)

@prose = Genre.find_by_name('Prose').submissions.find(:all, :include
=> :comments, :conditions => ['comments.editor_id != ? OR comments.id
IS NULL', @user.id])

Can anyone explain why this would stop working when a second comment
is made? Anyone have suggestions for implementing this better?

Thank you for your time,
Christian

--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to