Added the possiblity to inherit attribute filter and overwrite/extend via child methods.

This commit is contained in:
Thorsten Eckel 2017-02-15 13:20:42 +01:00
parent d0a62ecc39
commit fc13598f79

View file

@ -105,6 +105,9 @@ returns
next if !respond_to?(real_ids) next if !respond_to?(real_ids)
attributes[real_ids] = send(real_ids) attributes[real_ids] = send(real_ids)
} }
filter_attributes(attributes)
Cache.write(key, attributes) Cache.write(key, attributes)
attributes attributes
end end
@ -164,12 +167,16 @@ returns
attributes[destination] = user.login attributes[destination] = user.login
} }
filter_attributes(attributes)
attributes
end
def filter_attributes(attributes)
# remove forbitten attributes # remove forbitten attributes
%w(password token tokens token_ids).each { |item| %w(password token tokens token_ids).each { |item|
attributes.delete(item) attributes.delete(item)
} }
attributes
end end
=begin =begin