app/models/email_address.rb in has_emails-0.2.1 vs app/models/email_address.rb in has_emails-0.3.0

- old
+ new

@@ -4,22 +4,23 @@ # Email addresses are directly associated with emails and, therefore, should be # used for building and delivering new e-mails. # # == Associations # -# Email addresses have the following associations defined as a result of using the -# +has_emails+ macro: -# * +emails+ - Emails that were composed and are visible to the owner. Emails may have been sent or unsent. -# * +received_emails+ - Emails that have been received from others and are visible. Emails may have been read or unread. +# Email addresses have the following associations defined as a result of using +# the +has_emails+ macro: +# * +emails+ - Emails that were composed and are visible to the owner. Emails +# may have been sent or unsent. +# * +received_emails+ - Emails that have been received from others and are +# visible. Emails may have been read or unread. # * +unsent_emails+ - Emails that have not yet been delivered # * +sent_emails+ - Emails that have already been delivered class EmailAddress < ActiveRecord::Base has_emails - validates_presence_of :spec - validates_as_email_address :spec - validates_uniqueness_of :spec, - :scope => 'name' + validates_presence_of :spec + validates_as_email_address :spec + validates_uniqueness_of :spec, :scope => 'name' class << self # Finds or create an email address based on the given value def find_or_create_by_address(address) name, spec = split_address(address)