philomena-dev / philomena

Next-generation imageboard
GNU Affero General Public License v3.0
84 stars 29 forks source link

Fix MFA usage in cast_assoc #267

Closed liamwhite closed 1 month ago

liamwhite commented 1 month ago

Fixes this deprecation:

 warning: passing a MFA to :with in cast_assoc/cast_embed is deprecated, please pass an anonymous function instead
   (ecto 3.11.1) lib/ecto/changeset/relation.ex:119: Ecto.Changeset.Relation.do_cast/7
   (ecto 3.11.1) lib/ecto/changeset/relation.ex:365: Ecto.Changeset.Relation.map_changes/11
   (ecto 3.11.1) lib/ecto/changeset/relation.ex:112: Ecto.Changeset.Relation.cast/5
   (ecto 3.11.1) lib/ecto/changeset.ex:1278: Ecto.Changeset.cast_relation/4
   (philomena 1.1.0) lib/philomena/conversations/conversation.ex:60: Philomena.Conversations.Conversation.creation_changeset/3
   (philomena 1.1.0) lib/philomena/conversations.ex:43: Philomena.Conversations.create_conversation/2

These were the only two MFA instances used with Ecto. The remaining MFA instances are in ExqSupervisor and the search parser where I am not aware of any deprecations.