mirror of
https://github.com/kemko/paperclip.git
synced 2026-01-01 16:05:40 +03:00
для кирилла
This commit is contained in:
@@ -220,7 +220,7 @@ module Paperclip
|
||||
attachment_definitions[name] = Attachment.build_class(name, options)
|
||||
const_set("#{name}_attachment".camelize, attachment_definitions[name])
|
||||
|
||||
after_commit :save_attached_files
|
||||
after_commit :save_attached_files, if: :persisted?
|
||||
after_commit :destroy_attached_files, on: :destroy
|
||||
after_commit :flush_attachment_jobs
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ module Paperclip
|
||||
|
||||
def flush_writes # :nodoc:
|
||||
return if queued_for_write.empty?
|
||||
|
||||
return if instance.destroyed?
|
||||
# если есть, что записывать (queued_for_write), значит, данные устарели
|
||||
instance[self.class.synced_field_name(self.class.main_store_id)] = false
|
||||
sync_to(self.class.main_store_id, queued_for_write)
|
||||
@@ -232,6 +232,7 @@ module Paperclip
|
||||
cache_control: "max-age=#{10.years.to_i}",
|
||||
acl: 'public-read'
|
||||
}.merge(self.class.upload_options)
|
||||
|
||||
files.each do |style, file|
|
||||
path = key(style)
|
||||
file.rewind
|
||||
|
||||
Reference in New Issue
Block a user