Class: Engine2::DownloadBlobStoreAction
- Includes:
- BlobSupportAction
- Defined in:
- lib/engine2/action/infra.rb
Instance Attribute Summary
Attributes inherited from Action
#assets, #invokable, #meta, #node, #static
Instance Method Summary collapse
Methods included from BlobSupportAction
Methods inherited from Action
action_type, #action_type, #arguments, #check_anonymous_action_class, #check_static_action, #define_invoke, #define_method, #dynamic?, #execute, #freeze_action, #http_method, http_method, inherit, inherited, #initialize, #invoke!, #join_keys, #lookup, #merge, #node_defined, #post_process, #post_run, #pre_run, #repeat, #request, #request_action_proc_params, #split_keys
Constructor Details
This class inherits a constructor from Engine2::Action
Instance Method Details
#invoke(handler) ⇒ Object
139 140 141 142 143 144 145 146 |
# File 'lib/engine2/action/infra.rb', line 139 def invoke handler model = node.parent.*.model inf = model.type_info[node.parent.*.field] handler.permit id = handler.params[:id] entry = model.naked.select(inf[:bytes_field], inf[:name_field], inf[:mime_field]).where(model.primary_keys_hash(split_keys(id))).first serve_blob(handler, entry, inf) end |