forked from bofh/fetsite
error fixes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user