Class: Engine2::UploadBlobStoreMeta
- Defined in:
- lib/engine2/meta/infra_meta.rb
Instance Attribute Summary
Attributes inherited from Meta
#action, #assets, #invokable, #static
Instance Method Summary collapse
Methods inherited from Meta
#action_defined, #check_static_meta, #dynamic?, #freeze_meta, #get, http_method, #http_method, inherited, #initialize, #invoke!, #lookup, #merge, #meta_type, meta_type, #post_process, #post_run, #pre_run, #request, #request_meta_proc_params, #response, #split_keys
Constructor Details
This class inherits a constructor from Engine2::Meta
Instance Method Details
#invoke(handler) ⇒ Object
170 171 172 173 174 175 176 177 178 |
# File 'lib/engine2/meta/infra_meta.rb', line 170 def invoke handler file = handler.params[:file] temp = file[:tempfile] temp.close rackname = File.basename(temp.path) info = action.parent.*.model.type_info[action.parent.*.field] File.rename(temp.path, "#{info[:store][:upload]}/#{rackname}") {rackname: rackname} end |