Hallo.
Ich habe ein kleine Problem und benötige eure Hilfe.
Ich habe Kommentar die mit commentable_type und commentable_id an ein
Objekt gebunden sind. Im aktuellen Fall ist commentable nur ein
BlogEntry.
Ein BlogEntry liegt in einer Kategorie. Ein Kategorie kann sichtbar oder
unsichtbar sein. Ich möchte aber nur Kommentare anzeigen wenn der
BlogEntry wo das Kommentar geschrieben wurde in einer sichtbaren
Kategorie sind.
So etwas in der Art:
Comment.find(:all, :include => {:commentable => :category}, :conditions
=> {:commentable.category.visible => true})
Kann das so in etwas funktionieren?
Bitte um eure Hilfe.
danke
Michael
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
rubyonrails-ug mailing list
[email protected]
http://mailman.headflash.com/listinfo/rubyonrails-ug