app/controllers/digital_assets_controller.rb in daengine-0.6.1 vs app/controllers/digital_assets_controller.rb in daengine-0.6.2
- old
+ new
@@ -1,8 +1,8 @@
class DigitalAssetsController < ApplicationController
include DigitalAssetsHelper
- respond_to :json, :html, :only => [:index, :show, :search, :fund_docs]
+ respond_to :json
skip_filter(*_process_action_callbacks.map(&:filter))
CACHE_LAST_PARSE_TIME = 'last_parse_time'
# GET /digital_assets
@@ -30,24 +30,23 @@
end
alias :create :update
def destroy
- da = DigitalAsset.where(:digital_asset_id => params[:id])
- da[0].delete if da.present?
+ da = DigitalAsset.find(params[:id])
+ da.delete
head :ok
end
def updated_time
- Daengine.log "updated_time params #{params.inspect}", "info"
ids = params[:ids]
updated_time = Hash.new
ids.each do |id|
da = DigitalAsset.where(:digital_asset_id => id)
updated_time[id] = da[0].doc_changed_at if da.present?
end
- Daengine.log "updated_time result #{updated_time.inspect}", "info"
- render json: updated_time.to_json, status: :ok
+ # render json: updated_time.to_json, status: :ok
+ respond_with(updated_time)
end
def fund_docs
@digital_assets = []
fund_doctypes = {:doctype => [