Skip to content

Instantly share code, notes, and snippets.

@ConnorRigby
Created December 2, 2016 21:12
Show Gist options
  • Save ConnorRigby/7613f03d1d3174758d4dc4b83ae82765 to your computer and use it in GitHub Desktop.
Save ConnorRigby/7613f03d1d3174758d4dc4b83ae82765 to your computer and use it in GitHub Desktop.
iex(1)> h Farmbot.Sync.Database.Device.validate
def validate(map)
Makes sure an object can be built given keys: ["id", "planting_area_id",
"name", "webcam_url"]
• makes sure map is not empty
• makes sure we have atleast: ["id", "planting_area_id", "name",
"webcam_url"]
• Runs any defined mutations
• returns { :ok, %Elixir.Farmbot.Sync.Database.Device{} }
iex(2)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment