Repository: phoenixframework/phoenix
Pull request #4582 (2021-11-08 20:24:26)

Update ecto.md
small grammatical improvement


Patch:
diff --git a/README.md b/README.md
index 0f6474593..ea76288d7 100644
--- a/README.md
+++ b/README.md
@@ -68,7 +68,6 @@ $ mix archive.build
 ```bash
 $ cd assets
 $ npm install
-$ npm run watch
 ```
 
 ## Important links
diff --git a/guides/deployment/deployment.md b/guides/deployment/deployment.md
index 35f263569..d7bb14ce9 100644
--- a/guides/deployment/deployment.md
+++ b/guides/deployment/deployment.md
@@ -29,7 +29,7 @@ $ export DATABASE_URL=ecto://USER:PASS@HOST/database
 
 Do not copy those values directly, set `SECRET_KEY_BASE` according to the result of `mix phx.gen.secret` and `DATABASE_URL` according to your database address.
 
-If for some reason you do not want to rely on environment variables, you can hard code the secrets in your `config/runtime.exs` (formerly `config/prod.secret.exs` or `config/releases.exs`), but make sure not to check the file into your version control system.
+If for some reason you do not want to rely on environment variables, you can hard code the secrets in your `config/runtime.exs` but make sure not to check the file into your version control system.
 
 With your secret information properly secured, it is time to configure assets!
 
diff --git a/guides/ecto.md b/guides/ecto.md
index e463c4486..5df20fb83 100644
--- a/guides/ecto.md
+++ b/guides/ecto.md
@@ -393,7 +393,7 @@ There are many more validations and transformations we can perform in a changese
 
 ## Data persistence
 
-We've explored migrations and schemas, but we haven't yet persisted any of our schemas or changesets. We briefly looked at our repository module in `lib/hello/repo.ex` earlier, now it's time to put it to use.
+We've explored migrations and schemas, but we haven't yet persisted any of our schemas or changesets. We briefly looked at our repository module in `lib/hello/repo.ex` earlier, and now it's time to put it to use.
 
 Ecto repositories are the interface into a storage system, be it a database like PostgreSQL or an external service like a RESTful API. The `Repo` module's purpose is to take care of the finer details of persistence and data querying for us. As the caller, we only care about fetching and persisting data. The `Repo` module takes care of the underlying database adapter communication, connection pooling, and error translation for database constraint violations.
 
@@ -590,4 +590,4 @@ The data world is your oyster, but we won't be covering these options in these g
 [`Repo.one/2`]: `c:Ecto.Repo.one/2`
 [`Repo.update_all/3`]: `c:Ecto.Repo.update_all/3`
 [`Repo.update/2`]: `c:Ecto.Repo.update/2`
-[`timestamps/1`]: `Ecto.Migration.timestamps/1`
\ No newline at end of file
+[`timestamps/1`]: `Ecto.Migration.timestamps/1`
diff --git a/guides/real_time/channels.md b/guides/real_time/channels.md
index c3d2662a1..c93968a40 100644
--- a/guides/real_time/channels.md
+++ b/guides/real_time/channels.md
@@ -168,7 +168,7 @@ The following libraries exist today, and new ones are always welcome.
 
 #### Official
 
-Phoenix ships with a JavaScript client that is available when generating a new Phoenix project. The documentation for the JavaScript module is available at [https://hexdocs.pm/phoenix/js/](https://hexdocs.pm/phoenix/js/); the code is in [phoenix.js](https://github.com/phoenixframework/phoenix/blob/master/assets/js/phoenix.js).
+Phoenix ships with a JavaScript client that is available when generating a new Phoenix project. The documentation for the JavaScript module is available at [https://hexdocs.pm/phoenix/js/](https://hexdocs.pm/phoenix/js/); the code is in [multiple js files](https://github.com/phoenixframework/phoenix/blob/master/assets/js/phoenix/).
 
 #### 3rd Party
 
diff --git a/priv/templates/phx.gen.channel/channel.ex b/priv/templates/phx.gen.channel/channel.ex
index 4c1cf8215..0f7a9b5e5 100644
--- a/priv/templates/phx.gen.channel/channel.ex
+++ b/priv/templates/phx.gen.channel/channel.ex
@@ -21,7 +21,7 @@ defmodule <%= module %>Channel do
   # broadcast to everyone in the current topic (<%= singular %>:lobby).
   @impl true
   def handle_in("shout", payload, socket) do
-    broadcast socket, "shout", payload
+    broadcast(socket, "shout", payload)
     {:noreply, socket}
   end
 


Test patch:
diff --git a/priv/templates/phx.gen.channel/channel_test.exs b/priv/templates/phx.gen.channel/channel_test.exs
index 6fc15ebde..7698d8700 100644
--- a/priv/templates/phx.gen.channel/channel_test.exs
+++ b/priv/templates/phx.gen.channel/channel_test.exs
@@ -11,17 +11,17 @@ defmodule <%= module %>ChannelTest do
   end
 
   test "ping replies with status ok", %{socket: socket} do
-    ref = push socket, "ping", %{"hello" => "there"}
+    ref = push(socket, "ping", %{"hello" => "there"})
     assert_reply ref, :ok, %{"hello" => "there"}
   end
 
   test "shout broadcasts to <%= singular %>:lobby", %{socket: socket} do
-    push socket, "shout", %{"hello" => "all"}
+    push(socket, "shout", %{"hello" => "all"})
     assert_broadcast "shout", %{"hello" => "all"}
   end
 
   test "broadcasts are pushed to the client", %{socket: socket} do
-    broadcast_from! socket, "broadcast", %{"some" => "data"}
+    broadcast_from!(socket, "broadcast", %{"some" => "data"})
     assert_push "broadcast", %{"some" => "data"}
   end
 end
diff --git a/test/mix/tasks/phx.gen.auth_test.exs b/test/mix/tasks/phx.gen.auth_test.exs
index 962bc4a18..732eb9937 100644
--- a/test/mix/tasks/phx.gen.auth_test.exs
+++ b/test/mix/tasks/phx.gen.auth_test.exs
@@ -545,7 +545,7 @@ defmodule Mix.Tasks.Phx.Gen.AuthTest do
     end
   end
 
-  test "supports --binary_id option", config do
+  test "supports --binary-id option", config do
     in_tmp_phx_project(config.test, fn ->
       Gen.Auth.run(
         ~w(Accounts User users --binary-id),
diff --git a/test/mix/tasks/phx.gen.channel_test.exs b/test/mix/tasks/phx.gen.channel_test.exs
index c21f7c581..fb1fa7365 100644
--- a/test/mix/tasks/phx.gen.channel_test.exs
+++ b/test/mix/tasks/phx.gen.channel_test.exs
@@ -27,7 +27,7 @@ defmodule Mix.Tasks.Phx.Gen.ChannelTest do
         assert file =~ ~S|def handle_in("ping", payload, socket) do|
         assert file =~ ~S|{:reply, {:ok, payload}, socket}|
         assert file =~ ~S|def handle_in("shout", payload, socket) do|
-        assert file =~ ~S|broadcast socket, "shout", payload|
+        assert file =~ ~S|broadcast(socket, "shout", payload)|
         assert file =~ ~S|{:noreply, socket}|
       end)
 
@@ -38,15 +38,15 @@ defmodule Mix.Tasks.Phx.Gen.ChannelTest do
         assert file =~ ~S|> subscribe_and_join(PhoenixWeb.RoomChannel|
 
         assert file =~ ~S|test "ping replies with status ok"|
-        assert file =~ ~S|ref = push socket, "ping", %{"hello" => "there"}|
+        assert file =~ ~S|ref = push(socket, "ping", %{"hello" => "there"})|
         assert file =~ ~S|assert_reply ref, :ok, %{"hello" => "there"}|
 
         assert file =~ ~S|test "shout broadcasts to room:lobby"|
-        assert file =~ ~S|push socket, "shout", %{"hello" => "all"}|
+        assert file =~ ~S|push(socket, "shout", %{"hello" => "all"})|
         assert file =~ ~S|assert_broadcast "shout", %{"hello" => "all"}|
 
         assert file =~ ~S|test "broadcasts are pushed to the client"|
-        assert file =~ ~S|broadcast_from! socket, "broadcast", %{"some" => "data"}|
+        assert file =~ ~S|broadcast_from!(socket, "broadcast", %{"some" => "data"})|
         assert file =~ ~S|assert_push "broadcast", %{"some" => "data"}|
       end)
     end)