Skip to content

Instantly share code, notes, and snippets.

@fsvehla
Created July 13, 2009 22:33
Show Gist options
  • Save fsvehla/146501 to your computer and use it in GitHub Desktop.
Save fsvehla/146501 to your computer and use it in GitHub Desktop.
class ContactMail < ActiveRecord::Base
has_no_table
column :name, :string
column :number, :string
column :email_address, :string
column :text, :string
validates_presence_of :name,
:message => 'Bitte geben Sie einen Namen an'
validates_presence_of :text,
:message => 'Bitte geben Sie einen Text an'
def validate
errors.add(:number, 'Bitte geben Sie entweder eine Telefonnummer oder E-Mail-Addresse ein.') if number.blank? && email_address.blank?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment