Module: Card::Set::Abstract::Attachment::UploadCache
- Extended by:
- Card::Set
- Defined in:
- tmpsets/set/mod015-carrierwave/abstract/attachment/upload_cache.rb
Constant Summary
Constants included from Format
Instance Attribute Summary collapse
-
#action_id_of_cached_upload ⇒ Object
action id of the cached upload.
Instance Method Summary collapse
- #assign_attachment(file, original_filename) ⇒ Object
- #preliminary_upload? ⇒ Boolean
- #save_preliminary_upload? ⇒ Boolean
-
#tmp_upload_dir(_action_id = nil) ⇒ Object
place for files if card doesn't have an id yet.
-
#upload_cache_card ⇒ Object
used for uploads for new cards until the new card is created.
Methods included from I18nScope
Methods included from Loader
#clean_empty_module_from_hash, #clean_empty_modules, #extended, #process_base_modules, #register_set
Methods included from Helpers
#abstract_set?, #all_set?, #num_set_parts, #shortname
Methods included from Card::Set::AdvancedApi
#attachment, #ensure_set, #stage_method
Methods included from Format
#all_set_format_mod!, #define_on_format, #format, #register_set_format, #view
Methods included from Inheritance
#include_set, #include_set_formats
Methods included from Basket
#abstract_basket, #add_to_basket, #basket
Methods included from Trait
#card_accessor, #card_reader, #card_writer
Methods included from Event
Instance Attribute Details
#action_id_of_cached_upload ⇒ Object
action id of the cached upload
5 6 7 |
# File 'tmpsets/set/mod015-carrierwave/abstract/attachment/upload_cache.rb', line 5 def action_id_of_cached_upload @action_id_of_cached_upload end |
Instance Method Details
#assign_attachment(file, original_filename) ⇒ Object
43 44 45 46 47 |
# File 'tmpsets/set/mod015-carrierwave/abstract/attachment/upload_cache.rb', line 43 def file, original_filename send "#{}=", file write_identifier @current_action.update_attributes! comment: original_filename end |
#preliminary_upload? ⇒ Boolean
69 70 71 |
# File 'tmpsets/set/mod015-carrierwave/abstract/attachment/upload_cache.rb', line 69 def preliminary_upload? Card::Env && Card::Env.params[:attachment_upload] end |
#save_preliminary_upload? ⇒ Boolean
73 74 75 |
# File 'tmpsets/set/mod015-carrierwave/abstract/attachment/upload_cache.rb', line 73 def save_preliminary_upload? @action_id_of_cached_upload.present? end |
#tmp_upload_dir(_action_id = nil) ⇒ Object
place for files if card doesn't have an id yet
78 79 80 |
# File 'tmpsets/set/mod015-carrierwave/abstract/attachment/upload_cache.rb', line 78 def tmp_upload_dir _action_id=nil "#{files_base_dir}/#{upload_cache_card.id}" end |
#upload_cache_card ⇒ Object
used for uploads for new cards until the new card is created
65 66 67 |
# File 'tmpsets/set/mod015-carrierwave/abstract/attachment/upload_cache.rb', line 65 def upload_cache_card @upload_cache_card ||= Card["new_#{}".to_sym] end |