app/controllers/fiona7/blobs_controller.rb in infopark_fiona7-0.30.0.2 vs app/controllers/fiona7/blobs_controller.rb in infopark_fiona7-0.70.0.1

- old
+ new

@@ -1,35 +1,25 @@ module Fiona7 class BlobsController < ActionController::Base - # required for ensure_object_is_permitted - cattr_accessor :current_user_proc - self.current_user_proc = proc { nil } - include RailsConnector::CmsAccessible - before_filter :load_object - before_filter :ensure_object_is_active - before_filter :ensure_object_is_permitted - before_filter :set_google_expire_header + include Fiona7::BinaryHandling::DeliveryMixin - def show - if @obj.binary? - deliver_file - else - head :bad_request - end + protected + + def binary_id_from_params + params[:id] end - protected - def load_object - obj_id = params[:id].to_i - @obj = InternalReleasedObj.find(obj_id) - rescue ActiveRecord::RecordNotFound - head :not_found - return false + def transformation_from_params + if params[:t] + BinaryHandling::ParamEncoder.new.decode( + params[:t] + ) + end end - def current_user - self.class.current_user_proc.try(:call, self) + def set_header(name, value) + response.headers[name] = value end end end