error fixes

This commit is contained in:
2014-06-14 14:16:16 +02:00
parent 25743f8b9f
commit b1c46a3dc3
10 changed files with 29 additions and 11 deletions

View File

@@ -31,10 +31,12 @@ class Fetprofile < ActiveRecord::Base
accepts_nested_attributes_for :memberships, :reject_if=>lambda{|a| a[:typ].blank?|| a[:start].blank? ||a[:gremium_id].blank?}, :allow_destroy=>true
has_many :nlinks, as: :link
def validate_birthday
unless Date.valid_date?(birth_year, birth_month, birth_day)
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")
end
end
end
def title

View File

@@ -38,7 +38,7 @@ belongs_to :fetprofile
def self.find_for_facebook_oauth(auth, signed_in_resource=nil)
logger.debug auth.to_s
logger.debug "DDD Username= #{auth.username}"
# user = User.where(:provider => auth.provider, :uid => auth.uid).first
user = User.where(:provider => auth.provider, :uid => auth.extra.raw_info.uid).first
unless user
user = User.create(name:auth.uid,
provider:auth.provider,