FarmBot/Farmbot-Web-App

View on GitHub
app/mutations/webcam_feeds/update.rb

Summary

Maintainability
A
15 mins
Test Coverage
module WebcamFeeds
  class Update < Mutations::Command
    required { model :webcam_feed, class: WebcamFeed }

    optional do
      string :name
      string :url
    end

    def execute
      webcam_feed.update!(inputs.except(:webcam_feed)) && webcam_feed
    end
  end
end