Browse Source

sichere Datenrückgabe

hmt 9 years ago
parent
commit
e61f43ff8d
2 changed files with 3 additions and 2 deletions
  1. 2 1
      lib/schild.rb
  2. 1 1
      lib/schild/version.rb

+ 2 - 1
lib/schild.rb

@@ -59,6 +59,7 @@ module SchildTypeSaver
       define_method(name) do |allow_nil=false|
         ret = public_send(column)
         if allow_nil || ret
+          ret = ret.strftime("%d.%m.%Y") if ret.class == Time && allow_nil
           ret
         else
          create_null_object(klass, column)
@@ -250,7 +251,7 @@ module SchildErweitert
 
     # gibt an, ob der Schüler zu einem Zeitpunkt *datum* volljährig war.
     def volljaehrig_bei?(datum)
-      geb, datum = self.geburtsdatum.to_date, datum.to_date
+      geb, datum = self.Geburtsdatum.to_date, datum.to_date
       (datum.year - geb.year - ((datum.month > geb.month || (datum.month == geb.month && datum.day >= geb.day)) ? 0 : 1)) >= 18
     end
 

+ 1 - 1
lib/schild/version.rb

@@ -1,3 +1,3 @@
 module Schild
-  VERSION = "0.6.1"
+  VERSION = "0.6.2"
 end