bump version, and fix point

This commit is contained in:
connor rigby 2017-08-09 10:20:10 -07:00
parent e0bc36e248
commit ce6842dbf0
2 changed files with 6 additions and 15 deletions

View file

@ -1 +1 @@
5.0.0
5.0.1

View file

@ -23,19 +23,10 @@ defmodule Farmbot.Database.Syncable.Point do
Turn a tool into a Point.
"""
def get_tool(%Context{} = context, tool_id) do
all = Database.get_all context, __MODULE__
require IEx; IEx.pry
maybe_point = Enum.find all, fn(%{body: point}) ->
point.tool_id == tool_id
end
unless maybe_point do
raise SelectorError,
syncable: __MODULE__,
syncable_id: tool_id,
message: "Could not find tool_slot with tool_id: #{tool_id}"
end
maybe_point
context
|> (Database.get_all(__MODULE__)) || []
|> (Enum.find(fn(%{body: point}) -> point.tool_id == tool_id end)) ||
raise SelectorError, syncable: __MODULE__, syncable_id: tool_id,
message: "Could not find tool_slot with tool_id: #{tool_id}"
end
end