@@ -70,42 +70,18 @@ defmodule AshJsonApi.Resource.Info do
7070 Extension . get_opt ( resource , [ :json_api ] , :default_fields , nil , true )
7171 end
7272
73- @ doc """
74- Returns the `relationship_meta` config for the resource.
75-
76- This is a keyword list keyed by relationship name, where each value is
77- another keyword list mapping JSON:API meta keys to join resource attributes.
78- """
79- def relationship_meta ( resource ) do
80- Extension . get_opt ( resource , [ :json_api ] , :relationship_meta , [ ] , true )
81- end
82-
8373 @ doc """
8474 Returns the `relationship_meta_in` config for the resource.
85- Falls back to `relationship_meta` when not set.
8675 """
8776 def relationship_meta_in ( resource ) do
88- Extension . get_opt (
89- resource ,
90- [ :json_api ] ,
91- :relationship_meta_in ,
92- relationship_meta ( resource ) ,
93- true
94- )
77+ Extension . get_opt ( resource , [ :json_api ] , :relationship_meta_in , [ ] , true )
9578 end
9679
9780 @ doc """
9881 Returns the `relationship_meta_out` config for the resource.
99- Falls back to `relationship_meta` when not set.
10082 """
10183 def relationship_meta_out ( resource ) do
102- Extension . get_opt (
103- resource ,
104- [ :json_api ] ,
105- :relationship_meta_out ,
106- relationship_meta ( resource ) ,
107- true
108- )
84+ Extension . get_opt ( resource , [ :json_api ] , :relationship_meta_out , [ ] , true )
10985 end
11086
11187 @ doc """
@@ -122,16 +98,6 @@ defmodule AshJsonApi.Resource.Info do
12298 relationship_meta_out ( resource ) [ relationship_name ] || [ ]
12399 end
124100
125- @ doc """
126- Returns the meta-to-join-attribute mapping for the given relationship name.
127-
128- The result is a keyword list like `[note: :note_on_join]`, where the key is the
129- JSON:API meta key (as an atom) and the value is the join resource attribute.
130- """
131- def relationship_meta_mapping ( resource , relationship_name ) do
132- relationship_meta_in_mapping ( resource , relationship_name )
133- end
134-
135101 defp camelize ( name ) do
136102 camelized = name |> to_string ( ) |> Macro . camelize ( )
137103 { first , rest } = String . split_at ( camelized , 1 )
0 commit comments