Skip to content

Instantly share code, notes, and snippets.

@reagent
Forked from efatsi/participant.rb
Created October 16, 2012 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reagent/3902431 to your computer and use it in GitHub Desktop.
Save reagent/3902431 to your computer and use it in GitHub Desktop.
class Particpant < AR::Base
delegate :require_name?, :require_email?, :require_phone?, :to => :project, :allow_nil => true
with_options :on => :update do
validates_presence_of :name, :if => :require_name?
validates_presence_of :email, :if => :require_email?
validates_presence_of :phone, :if => :require_phone?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment