soft_trash 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.idea/soft_trash.iml +0 -19
- data/lib/soft_trash/model.rb +3 -24
- data/lib/soft_trash/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce4eabd039f208a6dcdc3c1a270bb47b34c46b3a4633aefec2a252ed70683924
|
4
|
+
data.tar.gz: 824dc188885a8b2999b8291bff33900fe6112206dc23fc1c2a8a105f538ae28a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a7a13afe251bf0b43708874a84954580e65314162707823c463f45fb1f8a6cff4db0453fbc7b185db8bfb75623d97c9ee7bd6fe5a3614780ff8d6276a3851c7
|
7
|
+
data.tar.gz: a7c4e908c896c22acf4306b02c3447dcb5ca6bae66229bbba8cda2478d4f8e3416f4dc4e7ce34e04299a1570f489d81512128ed2bec7415097d27c43c6fcd575
|
data/.idea/soft_trash.iml
CHANGED
@@ -15,27 +15,17 @@
|
|
15
15
|
<orderEntry type="library" scope="PROVIDED" name="actionview (v7.2.2.1, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
16
16
|
<orderEntry type="library" scope="PROVIDED" name="activesupport (v7.2.2.1, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
17
17
|
<orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
18
|
-
<orderEntry type="library" scope="PROVIDED" name="base64 (v0.2.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
19
18
|
<orderEntry type="library" scope="PROVIDED" name="benchmark (v0.4.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
20
|
-
<orderEntry type="library" scope="PROVIDED" name="bigdecimal (v3.1.9, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
21
19
|
<orderEntry type="library" scope="PROVIDED" name="builder (v3.3.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
22
|
-
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.6.2, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
23
20
|
<orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.3.5, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
24
|
-
<orderEntry type="library" scope="PROVIDED" name="connection_pool (v2.5.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
25
21
|
<orderEntry type="library" scope="PROVIDED" name="crass (v1.0.6, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
26
22
|
<orderEntry type="library" scope="PROVIDED" name="date (v3.4.1, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
27
|
-
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.5.1, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
28
23
|
<orderEntry type="library" scope="PROVIDED" name="drb (v2.2.1, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
29
24
|
<orderEntry type="library" scope="PROVIDED" name="erubi (v1.13.1, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
30
25
|
<orderEntry type="library" scope="PROVIDED" name="i18n (v1.14.7, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
31
26
|
<orderEntry type="library" scope="PROVIDED" name="io-console (v0.8.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
32
27
|
<orderEntry type="library" scope="PROVIDED" name="irb (v1.15.1, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
33
|
-
<orderEntry type="library" scope="PROVIDED" name="json (v2.9.1, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
34
28
|
<orderEntry type="library" scope="PROVIDED" name="language_server-protocol (v3.17.0.3, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
35
|
-
<orderEntry type="library" scope="PROVIDED" name="logger (v1.6.5, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
36
|
-
<orderEntry type="library" scope="PROVIDED" name="loofah (v2.24.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
37
|
-
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.25.4, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
38
|
-
<orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.18.2, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
39
29
|
<orderEntry type="library" scope="PROVIDED" name="parallel (v1.27.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
40
30
|
<orderEntry type="library" scope="PROVIDED" name="parser (v3.3.7.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
41
31
|
<orderEntry type="library" scope="PROVIDED" name="pp (v0.6.2, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
@@ -46,26 +36,17 @@
|
|
46
36
|
<orderEntry type="library" scope="PROVIDED" name="rack-session (v2.1.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
47
37
|
<orderEntry type="library" scope="PROVIDED" name="rack-test (v2.2.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
48
38
|
<orderEntry type="library" scope="PROVIDED" name="rackup (v2.2.1, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
49
|
-
<orderEntry type="library" scope="PROVIDED" name="rails-dom-testing (v2.2.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
50
39
|
<orderEntry type="library" scope="PROVIDED" name="rails-html-sanitizer (v1.6.2, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
51
40
|
<orderEntry type="library" scope="PROVIDED" name="railties (v7.2.2.1, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
52
41
|
<orderEntry type="library" scope="PROVIDED" name="rainbow (v3.1.1, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
53
|
-
<orderEntry type="library" scope="PROVIDED" name="rake (v13.2.1, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
54
42
|
<orderEntry type="library" scope="PROVIDED" name="rdoc (v6.11.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
55
43
|
<orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.10.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
56
44
|
<orderEntry type="library" scope="PROVIDED" name="reline (v0.6.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
57
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.13.1, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
58
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.13.3, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
59
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.13.2, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
60
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-rails (v7.0.1, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
61
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.13.1, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
62
45
|
<orderEntry type="library" scope="PROVIDED" name="rubocop (v1.71.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
63
46
|
<orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.37.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
64
47
|
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.13.0, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
65
48
|
<orderEntry type="library" scope="PROVIDED" name="securerandom (v0.4.1, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
66
|
-
<orderEntry type="library" scope="PROVIDED" name="sqlite3 (v1.7.3, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
67
49
|
<orderEntry type="library" scope="PROVIDED" name="stringio (v3.1.2, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
68
|
-
<orderEntry type="library" scope="PROVIDED" name="thor (v1.3.2, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
69
50
|
<orderEntry type="library" scope="PROVIDED" name="tzinfo (v2.0.6, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
70
51
|
<orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v3.1.4, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
71
52
|
<orderEntry type="library" scope="PROVIDED" name="unicode-emoji (v4.0.4, RVM: ruby-3.1.1 [global]) [gem]" level="application" />
|
data/lib/soft_trash/model.rb
CHANGED
@@ -37,26 +37,13 @@ module SoftTrash
|
|
37
37
|
|
38
38
|
|
39
39
|
#
|
40
|
-
# Person.where(age: 0..18).
|
40
|
+
# Person.where(age: 0..18).restore_all
|
41
41
|
def restore_all
|
42
42
|
deleted.each(&:restore)
|
43
43
|
end
|
44
44
|
|
45
|
-
|
46
|
-
#
|
47
|
-
# Each object's callbacks are executed.
|
48
|
-
# Returns the collection of objects that were undiscarded.
|
49
|
-
#
|
50
|
-
# Note: Instantiation, callback execution, and update of each
|
51
|
-
# record can be time consuming when you're undiscarding many records at
|
52
|
-
# once. It generates at least one SQL +UPDATE+ query per record (or
|
53
|
-
# possibly more, to enforce your callbacks). If you want to undiscard many
|
54
|
-
# rows quickly, without concern for their associations or callbacks, use
|
55
|
-
# #update_all!(discarded_at: nil) instead.
|
56
|
-
#
|
57
|
-
# ==== Examples
|
58
|
-
#
|
59
|
-
# Person.where(age: 0..18).undiscard_all!
|
45
|
+
|
46
|
+
# Person.where(age: 0..18).restore_all!
|
60
47
|
def restore_all!
|
61
48
|
deleted.each(&:restore!)
|
62
49
|
end
|
@@ -82,14 +69,6 @@ module SoftTrash
|
|
82
69
|
end
|
83
70
|
end
|
84
71
|
|
85
|
-
# Discard the record in the database
|
86
|
-
#
|
87
|
-
# There's a series of callbacks associated with #discard!. If the
|
88
|
-
# <tt>before_discard</tt> callback throws +:abort+ the action is cancelled
|
89
|
-
# and #discard! raises {Discard::RecordNotDiscarded}.
|
90
|
-
#
|
91
|
-
# @return [Boolean] true if successful
|
92
|
-
# @raise {Discard::RecordNotDiscarded}
|
93
72
|
def trash!
|
94
73
|
trash || _raise_record_not_trashed
|
95
74
|
end
|
data/lib/soft_trash/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soft_trash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mahendra.dabhi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-08-
|
11
|
+
date: 2025-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sqlite3
|