mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-14 23:47:48 +00:00
Currently when an admin tries to edit an no-existing enterprise, a NoMethodError is raised. This commit adds a set_enterprise setter method to the enterprises controller that sets the @enterprise instance variable to have the same value as the enterprise object defined in the the edit method; this method also rescues the NotFound error in case the enterprise is not found and redirects the user to the enterprises index page with a error message.