Module: Sequel::Plugins::Paperclip::InstanceMethods
- Defined in:
- lib/sequel_paperclip.rb
Instance Method Summary collapse
Instance Method Details
#after_destroy ⇒ Object
152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/sequel_paperclip.rb', line 152 def after_destroy self.class..each_key do |name| send("#{name}=", nil) end if @attachment_instances @attachment_instances.each_value do || .update_storage end end super end |
#after_save ⇒ Object
142 143 144 145 146 147 148 149 150 |
# File 'lib/sequel_paperclip.rb', line 142 def after_save if @attachment_instances @attachment_instances.each_value do || .process .update_storage end end super end |
#attachment_generate_basename(attachment) ⇒ Object
134 135 136 137 138 139 140 |
# File 'lib/sequel_paperclip.rb', line 134 def () basename = send("#{.name}_basename") while true new_basename = SecureRandom.hex(4).to_s return new_basename unless new_basename == basename end end |