File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,12 @@ defmodule AshPostgres.Test.Post do
154
154
155
155
defaults ( [ :read , :destroy ] )
156
156
157
+ read :with_version_check do
158
+ argument ( :version , :integer )
159
+
160
+ filter ( expr ( type ( ^ arg ( :version ) , :string ) in [ "1" , "2" ] ) )
161
+ end
162
+
157
163
read :first_and_last_post do
158
164
prepare ( fn query , _ ->
159
165
Ash.Query . combination_of ( query , [
Original file line number Diff line number Diff line change @@ -100,4 +100,11 @@ defmodule AshPostgres.Test.TypeTest do
100
100
assert % { x: 2.0 , y: 3.0 , z: 4.0 } = p . db_string_point_id
101
101
assert % { x: 2.0 , y: 3.0 , z: 4.0 } = p . db_string_point . id
102
102
end
103
+
104
+ test "casting integer to string works" do
105
+ Post |> Ash.Changeset . for_create ( :create ) |> Ash . create! ( )
106
+
107
+ post = Ash.Query . for_read ( Post , :with_version_check , version: 1 ) |> Ash . read! ( )
108
+ refute is_nil ( post )
109
+ end
103
110
end
You can’t perform that action at this time.
0 commit comments