Parent

Class/Module Index [+]

Quicksearch

Fetprofile

Schema Information

Table name: fetprofiles

id           :integer          not null, primary key
vorname      :string(255)
nachname     :string(255)
short        :string(255)
fetmailalias :string(255)
desc         :text
picture      :string(255)
active       :boolean
created_at   :datetime         not null
updated_at   :datetime         not null

Constants

GESCHLECHT

Public Instance Methods

adress() click to toggle source
# File app/models/fetprofile.rb, line 58
def adress
  connector= (self.street.nil?||self.street.empty?||(self.city.empty? && self.plz.empty?)) ? '' : ', '
  self.plz.to_s + ' ' + self.city.to_s + connector.to_s + self.street.to_s
end
birthday() click to toggle source
# File app/models/fetprofile.rb, line 62
def birthday
  unless self.birth_month.nil? || self.birth_day.nil?
  if self.birth_year.nil? || self.birth_year.zero?
    Date.new( Date.today.year,self.birth_month,self.birth_day)
  else
    Date.new( self.birth_year,self.birth_month,self.birth_day)
  end
  else
    nil
  end
end
fetmail() click to toggle source
# File app/models/fetprofile.rb, line 55
def fetmail
  (fetmailalias.nil? || fetmailalias.empty?) ? short.to_s + "@fet.at" : fetmailalias.to_s + "@fet.at"
end
name() click to toggle source
# File app/models/fetprofile.rb, line 51
def name
  [vorname, nachname, ((short.empty?)? "": ["(",short,")"].join)].join(" ")
end
title() click to toggle source
# File app/models/fetprofile.rb, line 48
def title
  self.name
end
validate_birthday() click to toggle source
# File app/models/fetprofile.rb, line 33
def validate_birthday
  unless birth_month.nil? || birth_day.nil?
    unless Date.valid_date?((birth_year.nil?) ? Date.today.year : birth_year, birth_month, birth_day)
      errors.add(:birth_month, "Invalides Datum")
      errors.add(:birth_day, "Invalides Datum")
      v= false
    else
      v= true
    end
  else
    v= false
  end
  v
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.