I'm trying to implement logical deletion on my model by extending the
has_many association, in a code like this:
class Post < ActiveRecord::Base
has_many :comments do
def self.comments
find :all, :conditions => 'confirmed is not null'
end
end
end
That would give you the ability to say some_post.comments.comments
(although you don't need the self. )
Why not just do this at the top level? ie
has_many :comments, :conditions => ...
Now I understand what I did but that's no quite what I was trying to
achieve. My goal was say some_post.comments and that would return only
the comments where the confirmed field wasn't null.