Reload the target object before updating if it is marked read-only
authorTom Clegg <tom@curoverse.com>
Wed, 15 Jan 2014 17:07:00 +0000 (09:07 -0800)
committerTom Clegg <tom@curoverse.com>
Wed, 15 Jan 2014 17:07:00 +0000 (09:07 -0800)
commit463e996ae5276dc41deca98cb444c802e6f5e251
tree5e8579fc7dc7a6fe92207c55318e1d562ca19f00
parent84f0a30a119355cd7deff1630a82d3d4c9a6d5ee
Reload the target object before updating if it is marked read-only
(e.g., it was retrieved using a join). Also, fix error response when
update is called on a non-existent object.

Prevents ActiveRecord::ReadOnlyRecord error.

refs #1871
amends 92d1022d103b58ddad0427736a776a27f198667e
services/api/app/controllers/application_controller.rb