diff --git a/lib/weather_station_manager/endpoint.ex b/lib/weather_station_manager/endpoint.ex index 76b25a4..4fb0597 100644 --- a/lib/weather_station_manager/endpoint.ex +++ b/lib/weather_station_manager/endpoint.ex @@ -1,8 +1,6 @@ defmodule WeatherStationManager.Endpoint do use Phoenix.Endpoint, otp_app: :weather_station_manager - socket "/socket", WeatherStationManager.UserSocket - # Serve at "/" the static files from "priv/static" directory. # # You should set gzip to true if you are running phoenix.digest diff --git a/mix.exs b/mix.exs index 648a371..cf21307 100644 --- a/mix.exs +++ b/mix.exs @@ -32,7 +32,6 @@ defmodule WeatherStationManager.Mixfile do # Type `mix help deps` for examples and options. defp deps do [{:phoenix, "~> 1.2.5"}, - {:phoenix_pubsub, "~> 1.0"}, {:phoenix_ecto, "~> 3.0"}, {:postgrex, ">= 0.0.0"}, {:gettext, "~> 0.11"}, diff --git a/test/models/update_test.exs b/test/models/update_test.exs index 2991713..d5f0d36 100644 --- a/test/models/update_test.exs +++ b/test/models/update_test.exs @@ -3,7 +3,6 @@ defmodule WeatherStationManager.UpdateTest do alias WeatherStationManager.Update - @invalid_attributes %{ :spam => "eggs" } @valid_attributes %{ :station => "South Yarra", :lat => 42.0, @@ -17,4 +16,3 @@ defmodule WeatherStationManager.UpdateTest do assert changeset.valid? end end - diff --git a/web/channels/user_socket.ex b/web/channels/user_socket.ex deleted file mode 100644 index 1ba836d..0000000 --- a/web/channels/user_socket.ex +++ /dev/null @@ -1,37 +0,0 @@ -defmodule WeatherStationManager.UserSocket do - use Phoenix.Socket - - ## Channels - # channel "room:*", WeatherStationManager.RoomChannel - - ## Transports - transport :websocket, Phoenix.Transports.WebSocket - # transport :longpoll, Phoenix.Transports.LongPoll - - # Socket params are passed from the client and can - # be used to verify and authenticate a user. After - # verification, you can put default assigns into - # the socket that will be set for all channels, ie - # - # {:ok, assign(socket, :user_id, verified_user_id)} - # - # To deny connection, return `:error`. - # - # See `Phoenix.Token` documentation for examples in - # performing token verification on connect. - def connect(_params, socket) do - {:ok, socket} - end - - # Socket id's are topics that allow you to identify all sockets for a given user: - # - # def id(socket), do: "users_socket:#{socket.assigns.user_id}" - # - # Would allow you to broadcast a "disconnect" event and terminate - # all active sockets and channels for a given user: - # - # WeatherStationManager.Endpoint.broadcast("users_socket:#{user.id}", "disconnect", %{}) - # - # Returning `nil` makes this socket anonymous. - def id(_socket), do: nil -end diff --git a/web/models/update.ex b/web/models/update.ex index 98702ae..e34f14a 100644 --- a/web/models/update.ex +++ b/web/models/update.ex @@ -7,7 +7,7 @@ defmodule WeatherStationManager.Update do field :lon, :float field :temperature, :float - timestamps + timestamps() end def changeset(struct, params \\ %{}) do @@ -15,4 +15,3 @@ defmodule WeatherStationManager.Update do |> cast(params, [:station, :lat, :lon, :temperature]) end end - diff --git a/web/web.ex b/web/web.ex index def54b6..e55a51d 100644 --- a/web/web.ex +++ b/web/web.ex @@ -58,17 +58,6 @@ defmodule WeatherStationManager.Web do end end - def channel do - quote do - use Phoenix.Channel - - alias WeatherStationManager.Repo - import Ecto - import Ecto.Query - import WeatherStationManager.Gettext - end - end - @doc """ When used, dispatch to the appropriate controller/view/etc. """