Skip to content

Commit

Permalink
fix(action): fix get_ids_from_request helper call on related data (#695)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasalexandre9 authored Nov 4, 2024
1 parent d8b4f84 commit 28a0371
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/services/forest_liana/resources_getter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,17 @@ def self.related_data?(attributes)
def self.related_data_params(attributes, user)
parent_model = SchemaUtils.find_model_from_collection_name(attributes[:parent_collection_name])
model = parent_model.reflect_on_association(attributes[:parent_association_name].to_sym)
[parent_model, model, attributes.merge(collection: attributes[:parent_collection_name]), user]

[
parent_model,
model,
attributes.merge(
collection: attributes[:parent_collection_name],
id: attributes[:parent_collection_id],
association_name: attributes[:parent_association_name]
),
user
]
end

def self.fetch_ids(resources_getter)
Expand Down

0 comments on commit 28a0371

Please sign in to comment.