Active Cards Models+solution
Maybe something like this:
class User < Card card_defaults :type=>Card::Phrase card_attribute :email, :status, :crypted_password, :salt, :password_reset_code card_attribute :invite_sender, :type => Card::PointerID inherited_attribute :email, :status # then expect to be able to use AR methods as if these are regular AR attributes attr_accessor :password, :name validates :email, :presence=>true, :if=>:email_required?, :uniqueness => { :scope => :login }, :format => { :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i }, :length => { :maximum => 100 } :id, :presence=>true, :confirmation=>true, :if=>:password_required?, :length => { :within => 5..40 } validates :password_confirmation, :presence=>true, :if=>:password_required? before_validation :downcase_email! before_save :encrypt_password end
Connect up the new events to save these values in the contents of the plus cards.