Module: CarrierWave::CardMount::Helper
- Defined in:
- mod/carrierwave/lib/carrier_wave/card_mount/helper.rb
Overview
helper methods for mounted cards
Instance Method Summary collapse
-
#read_uploader(*args) ⇒ Object
-
#reload(*_args) ⇒ Object
-
#serializable_hash(opts = nil) ⇒ Object
-
#write_uploader(*args) ⇒ Object
Instance Method Details
#read_uploader(*args) ⇒ Object
5 6 7 |
# File 'mod/carrierwave/lib/carrier_wave/card_mount/helper.rb', line 5 def read_uploader *args read_attribute(*args) end |
#reload(*_args) ⇒ Object
13 14 15 16 |
# File 'mod/carrierwave/lib/carrier_wave/card_mount/helper.rb', line 13 def reload *_args @_mounters = nil super end |
#serializable_hash(opts = nil) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'mod/carrierwave/lib/carrier_wave/card_mount/helper.rb', line 18 def serializable_hash opts=nil except = serializable_hash_config opts, :except only = serializable_hash_config opts, :only self.class.uploaders.each_with_object(super(opts)) do |(column, _uploader), hash| if add_column_to_serializable_hash? column.to_s, only, except hash[column.to_s] = _mounter(column).uploader.serializable_hash end end end |
#write_uploader(*args) ⇒ Object
9 10 11 |
# File 'mod/carrierwave/lib/carrier_wave/card_mount/helper.rb', line 9 def write_uploader *args write_attribute(*args) end |