Added the possiblity to inherit attribute filter and overwrite/extend via child methods.
This commit is contained in:
parent
d0a62ecc39
commit
fc13598f79
1 changed files with 9 additions and 2 deletions
|
@ -105,6 +105,9 @@ returns
|
|||
next if !respond_to?(real_ids)
|
||||
attributes[real_ids] = send(real_ids)
|
||||
}
|
||||
|
||||
filter_attributes(attributes)
|
||||
|
||||
Cache.write(key, attributes)
|
||||
attributes
|
||||
end
|
||||
|
@ -164,12 +167,16 @@ returns
|
|||
attributes[destination] = user.login
|
||||
}
|
||||
|
||||
filter_attributes(attributes)
|
||||
|
||||
attributes
|
||||
end
|
||||
|
||||
def filter_attributes(attributes)
|
||||
# remove forbitten attributes
|
||||
%w(password token tokens token_ids).each { |item|
|
||||
attributes.delete(item)
|
||||
}
|
||||
|
||||
attributes
|
||||
end
|
||||
|
||||
=begin
|
||||
|
|
Loading…
Reference in a new issue