Simplify RNAAdapter#to_params and unify the type of objects it returns

This commit is contained in:
gregoirenovel 2018-03-19 22:25:15 +01:00
parent caf2e50954
commit 681e33b850

View file

@ -5,10 +5,7 @@ class ApiEntreprise::RNAAdapter
end
def to_params
if data_source.present?
if data_source[:association][:id].nil?
return nil
end
if data_source.present? && data_source[:association][:id].present?
params = data_source[:association].slice(*attr_to_fetch)
params[:rna] = data_source[:association][:id]
params