Displaying 1 result from an estimated 1 matches for "recipient_is_not_regist".
2010 Feb 10
16
nil object - can anyone help?
...ctiveRecord::Base
#attr_accessible :sender_id, :recipient_email, :token, :sent_at
belongs_to :sender, :class_name => ''User''
has_one :recipient, :class_name => ''User''
###validation
validates_presence_of :recipient_email
validate :recipient_is_not_registered
validate :sender_has_invitations, :if => :sender
before_create :generate_token
before_create :decrement_sender_count, :if => :sender
private
def recipient_is_not_registered
errors.add :recipient_email, ''Is already registered''...