mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-13 16:45:18 +08:00
Merge pull request #8419 from okriuchykhin/ok_SCI_11757
Improve handling of file versions deletion [SCI-11757]
This commit is contained in:
commit
77e3b46752
1 changed files with 2 additions and 2 deletions
|
@ -5,8 +5,8 @@ module VersionedAttachments
|
|||
|
||||
class_methods do
|
||||
def has_one_versioned_attached(name)
|
||||
has_one_attached name, dependent: :detach
|
||||
has_many_attached "previous_#{name.to_s.pluralize}", dependent: :detach
|
||||
has_one_attached name
|
||||
has_many_attached "previous_#{name.to_s.pluralize}"
|
||||
|
||||
define_method :"attach_#{name}_version" do |*args, **options|
|
||||
ActiveRecord::Base.transaction(requires_new: true) do
|
||||
|
|
Loading…
Add table
Reference in a new issue