orthoses-paranoia 0.1.0 → 1.0.0
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/README.md +3 -4
- data/lib/orthoses/paranoia/version.rb +1 -1
- data/lib/orthoses/paranoia.rb +8 -9
- 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: 852e0761300eb8fb7947b9b5000bc2c8e8134ea024f84efbe1d091462facb919
|
4
|
+
data.tar.gz: 8eb24f19ad182007e5053980fc73bf462ec639f519790a6256766c01d8da88b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd75d77a629aef7cde60bc27e513fae026b497875f4aae6d5219996bd607d186a592bb22ba4db95cc565d406fc78f662605f91e5c098c405a55cc9b6af48e4f1
|
7
|
+
data.tar.gz: 7dd7874ef7d14d5a94e6c672d097e887c32098b2fddf21d8dbdda9e8b52c1d15d0dab51b10963b0336967003ef7b2233c17d175ae9d4bdae7962919f6325dd5d
|
data/README.md
CHANGED
@@ -5,22 +5,21 @@ Orthoses::Paranoia automatically generates RBS for methods added by Paranoia.
|
|
5
5
|
|
6
6
|
```rb
|
7
7
|
User.with_deleted #=> User::ActiveRecord_Relation
|
8
|
+
User.first.deleted? #=> bool
|
8
9
|
```
|
9
10
|
|
10
11
|
## Installation
|
11
12
|
|
12
|
-
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
13
|
-
|
14
13
|
Install the gem and add to the application's Gemfile by executing:
|
15
14
|
|
16
15
|
```bash
|
17
|
-
bundle add
|
16
|
+
bundle add orthoses-paranoia
|
18
17
|
```
|
19
18
|
|
20
19
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
21
20
|
|
22
21
|
```bash
|
23
|
-
gem install
|
22
|
+
gem install orthoses-paranoia
|
24
23
|
```
|
25
24
|
|
26
25
|
## Usage
|
data/lib/orthoses/paranoia.rb
CHANGED
@@ -17,17 +17,16 @@ module Orthoses
|
|
17
17
|
|
18
18
|
acts_as_paranoid.captures.each do |capture|
|
19
19
|
base_name = Utils.module_name(capture.method.receiver) or next
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
store[paranoia_class_methods].header = "module #{paranoia_class_methods}"
|
24
|
-
store[paranoia_class_methods] << "def with_deleted: () -> #{base_name}::ActiveRecord_Relation"
|
25
|
-
store[paranoia_class_methods] << "def only_deleted: () -> #{base_name}::ActiveRecord_Relation"
|
26
|
-
store[paranoia_class_methods] << "alias deleted only_deleted"
|
27
|
-
store[paranoia_class_methods] << "def paranoia_scope: () -> #{base_name}::ActiveRecord_Relation"
|
28
|
-
store[paranoia_class_methods] << "alias without_deleted paranoia_scope"
|
20
|
+
relation_class = "#{base_name}::ActiveRecord_Relation"
|
21
|
+
paranoia_instance_methods = "::Paranoia::InstanceMethods[#{base_name}]"
|
22
|
+
paranoia_class_methods = "::Paranoia::ClassMethods[#{base_name}, #{relation_class}]"
|
29
23
|
|
24
|
+
store[base_name] << "include #{paranoia_instance_methods}"
|
30
25
|
store[base_name] << "extend #{paranoia_class_methods}"
|
26
|
+
|
27
|
+
store[relation_class] << "include #{paranoia_class_methods}"
|
28
|
+
|
29
|
+
store["#{base_name}::ActiveRecord_Associations_CollectionProxy"] << "include #{paranoia_class_methods}"
|
31
30
|
end
|
32
31
|
|
33
32
|
store
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orthoses-paranoia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ksss
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: orthoses
|
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '0'
|
73
73
|
requirements: []
|
74
|
-
rubygems_version: 3.
|
74
|
+
rubygems_version: 3.8.0.dev
|
75
75
|
specification_version: 4
|
76
76
|
summary: Orthoses middleware for paranoia
|
77
77
|
test_files: []
|