Topic: Does anybody have an idea of what this line means?

I feel like I'm trying to dig to China with a rock pick decyphering the Beast code. Does anybody know what this line means?

before_create { |r| count(:all, :conditions => ['forum_id = ? and user_id = ?', r.forum_id, r.user_id]).zero?

It's a the top of a model declaration for the Moderatorship table. I've Googled on ".zero?" and can't find any topics. It almost appears as an ActiveRecord method but can't find it anywhere.
In common language, what do you think they're trying to accomplish here?
Thanks,
Kathy

Re: Does anybody have an idea of what this line means?

looks like code that is done before a record is created.  Returns r=true if there are no records in the model for a given forum and userid.

Ruby zero? returns true if the associated value is zero.

Re: Does anybody have an idea of what this line means?

Richard,
So if I'm following your logic (see code below)

class Moderatorship < ActiveRecord::Base
  belongs_to :forum
  belongs_to :user
  before_create { |r| count(:all, :conditions => ['forum_id = ? and user_id = ?', r.forum_id, r.user_id]).zero? }
end

This record will NOT be created if one is already in existence and being used?
Thanks,
Kathleen

Re: Does anybody have an idea of what this line means?

I'm not certain but I think so.

I would try to add and see.