app/controllers/digital_assets_controller.rb in daengine-0.6.21 vs app/controllers/digital_assets_controller.rb in daengine-0.6.22
- old
+ new
@@ -40,12 +40,12 @@
end
alias :create :update
def destroy
- da = DigitalAsset.find(params[:id])
- da.delete
- head :ok
+ da = DigitalAsset.first(conditions: {digital_asset_id: params[:id]})
+ da.delete unless da.nil?
+ head (da.nil? ? :not_found : :ok)
end
def updated_time
if(params[:ids].present?)
assets = DigitalAsset.where(:digital_asset_id.in => params[:ids])