)
end
- # Wrong name plz fix thx
- def all_by_object_ap_id(ap_id) do
+ def get_all_by_object_ap_id(ap_id) do
Repo.all(all_by_object_ap_id_q(ap_id))
end
# Update activities that already had this. Could be done in a seperate process.
# Alternatively, just don't do this and fetch the current object each time. Most
# could probably be taken from cache.
- relevant_activities = Activity.all_by_object_ap_id(id)
+ relevant_activities = Activity.get_all_by_object_ap_id(id)
Enum.map(relevant_activities, fn activity ->
new_activity_data = activity.data |> Map.put("object", object.data)
test "returns activities by it's objects AP ids" do
activity = insert(:note_activity)
- [found_activity] = Activity.all_by_object_ap_id(activity.data["object"]["id"])
+ [found_activity] = Activity.get_all_by_object_ap_id(activity.data["object"]["id"])
assert activity == found_activity
end
assert like_activity == same_like_activity
assert object.data["likes"] == [user.ap_id]
- [note_activity] = Activity.all_by_object_ap_id(object.data["id"])
+ [note_activity] = Activity.get_all_by_object_ap_id(object.data["id"])
assert note_activity.data["object"]["like_count"] == 1
{:ok, _like_activity, object} = ActivityPub.like(user_two, object)