Skip to content

Commit e575bfa

Browse files
committed
Remove warnings
1 parent b45a751 commit e575bfa

2 files changed

Lines changed: 5 additions & 17 deletions

File tree

lib/ecto_sync/subscriber.ex

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ defmodule EctoSync.Subscriber do
1515
|> Enum.flat_map(&subscribe(&1, opts))
1616
|> add_opts(opts)
1717
|> Enum.uniq()
18-
|> IO.inspect()
1918
|> Enum.map(fn {{watcher_identifier, id}, opts} ->
2019
do_subscribe(watcher_identifier, id, opts)
2120
end)
@@ -96,7 +95,7 @@ defmodule EctoSync.Subscriber do
9695
do:
9796
subscribe_events_assocs(
9897
Map.get(struct, k),
99-
through |> IO.inspect(label: :throug)
98+
through
10099
)
101100

102101
def subscribe_events(struct, %ManyToMany{
@@ -179,7 +178,6 @@ defmodule EctoSync.Subscriber do
179178
subscribe_events(value)
180179
|> add_opts(opts)
181180
|> Enum.concat(subscribe_events_assocs(value, opts[:assocs] || []))
182-
# |> IO.inspect(label: :unsubs)
183181
|> Enum.map(fn {{watcher_identifier, id} = event, _} ->
184182
unsubscribe(watcher_identifier, id)
185183
event
@@ -239,13 +237,10 @@ defmodule EctoSync.Subscriber do
239237
events =
240238
subscribe_events(parent, assoc_info)
241239
|> add_opts(opts)
242-
|> IO.inspect(label: :events)
243240

244241
events ++ acc
245242

246243
%Association.NotLoaded{} ->
247-
IO.puts(key)
248-
249244
# events =
250245
# subscribe_events(parent, nil)
251246
# |> add_opts(opts)

test/ecto_sync_test.exs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,8 @@ defmodule EctoSyncTest do
178178
test "inserted", %{person: person} do
179179
subscribe(person, assocs: @preloads)
180180

181-
{:ok, %{tags: [tag]} = post} =
181+
{:ok, %{tags: [tag]}} =
182182
TestRepo.insert(%Post{person_id: person.id, tags: [%{name: "test"}]})
183-
|> do_preload([:tags])
184183

185184
receive do
186185
{{Post, :inserted}, _} = sync_args ->
@@ -651,21 +650,15 @@ defmodule EctoSyncTest do
651650
end
652651

653652
test "updated", %{person_with_posts: person} do
654-
%{posts: [post | _]} =
655-
person =
656-
do_preload(person, @preloads)
657-
|> IO.inspect()
653+
%{posts: [post | _]} = person = do_preload(person, @preloads)
658654

659655
subscribe(person, assocs: @preloads)
660-
|> IO.inspect(label: :subscriptions)
661656

662657
{:ok, _} =
663-
Ecto.Changeset.change(post, %{name: "test"})
658+
post
659+
|> Ecto.Changeset.change(%{name: "test"})
664660
|> TestRepo.update()
665661

666-
# flush()
667-
# |> IO.inspect()
668-
669662
receive do
670663
{{Post, :updated}, _} = sync_args ->
671664
synced = EctoSync.sync(person, sync_args, preloads: %{Post => [:tags, :labels]})

0 commit comments

Comments
 (0)