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 def show if @obj.binary? deliver_file else head :bad_request end end protected def load_object obj_id = params[:id].to_i @obj = InternalReleasedObj.find(obj_id) rescue ActiveRecord::RecordNotFound head :not_found return false end def current_user self.class.current_user_proc.try(:call, self) end end end