effective_trash 0.4.3 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/effective/trash.rb +7 -3
- data/lib/effective_trash/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ac79bdbe58cfb775094f46dcb4c52196a9abce2fa0d1eed90cb90d6d5a4fa12
|
4
|
+
data.tar.gz: 497ddf1290194a279b721d28c5580c0c3ea14d2fe8374774d2cd482676e63dad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aaf122d97062b5bda53653fc88079f907fc4931412b22f42666cf34f8953aa0c10999cbbae23dbca0314bc015d8fb6d6d00a102d584993da0b8cfabdbaa111b5
|
7
|
+
data.tar.gz: 8536e72b5b8ace2ce1d66fcc6511e7fd2c163d28978d23bc54203701edb842483c9a293d2a7ed154c734226e1d0f167a829066e1cf27381ca71a983adc64a553
|
@@ -3,7 +3,7 @@ module Effective
|
|
3
3
|
self.table_name = EffectiveTrash.trash_table_name.to_s
|
4
4
|
|
5
5
|
belongs_to :trashed, polymorphic: true # The original item type and id. Note that this object will never exist as it's deleted.
|
6
|
-
belongs_to :user # The user that destroyed the original resource
|
6
|
+
belongs_to :user, optional: true # The user that destroyed the original resource
|
7
7
|
|
8
8
|
# Attributes
|
9
9
|
# trashed_type :string
|
@@ -14,7 +14,11 @@ module Effective
|
|
14
14
|
# details :text
|
15
15
|
# timestamps
|
16
16
|
|
17
|
-
|
17
|
+
if EffectiveResources.serialize_with_coder?
|
18
|
+
serialize :details, type: Hash, coder: YAML
|
19
|
+
else
|
20
|
+
serialize :details, Hash
|
21
|
+
end
|
18
22
|
|
19
23
|
scope :deep, -> { includes(:user, :trashed) }
|
20
24
|
scope :sorted, -> { order(:id) }
|
@@ -24,7 +28,7 @@ module Effective
|
|
24
28
|
end
|
25
29
|
|
26
30
|
def details
|
27
|
-
self[:details]
|
31
|
+
Hash(self[:details])
|
28
32
|
end
|
29
33
|
|
30
34
|
def to_object
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_trash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
requirements: []
|
119
|
-
rubygems_version: 3.
|
119
|
+
rubygems_version: 3.5.6
|
120
120
|
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: Trash and Restore any Active Record object.
|