lib/authpds/session/record.rb in authpds-0.2.9 vs lib/authpds/session/record.rb in authpds-1.0.0
- old
+ new
@@ -1,11 +1,12 @@
module Authpds
module Session
module Record
# Get the record associated with this PDS user.
def get_record(login)
- record = (klass.find_by_smart_case_login_field(login) || klass.new(login_field => login))
+ record = (klass.find_by_smart_case_login_field(login) ||
+ klass.new(login_field => login))
end
# Set the record information associated with this PDS user.
def set_record
self.attempted_record = get_record(pds_user.send(pds_record_identifier))
@@ -16,11 +17,12 @@
end
# Reset expired data
def reset_record(attempted_record)
pds_attributes.each do |record_attr, pds_attr|
+ next unless self.attempted_record.respond_to?("#{record_attr}=".to_sym)
attempted_record.send("#{record_attr}=".to_sym,
- pds_user.send(pds_attr.to_sym)) if self.attempted_record.respond_to?("#{record_attr}=".to_sym)
+ pds_user.send(pds_attr.to_sym))
end
pds_user.class.public_instance_methods(false).each do |pds_attr_reader|
attempted_record.user_attributes = {
pds_attr_reader.to_sym => pds_user.send(pds_attr_reader.to_sym) }
end
\ No newline at end of file