pundit-plus 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -2
- data/README.md +15 -2
- data/Rakefile +6 -0
- data/lib/pundit/plus/custom_exception.rb +6 -1
- data/lib/pundit/plus/version.rb +1 -1
- data/lib/pundit/plus.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: 7294e31ee669a032370e6f11411e14a21e35b0042cc17dcc4d12d95cff0100f0
|
4
|
+
data.tar.gz: '089db28a172510cb271460ef16b98593d30d963faafcd3df4284fa64010a35c3'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a96685a1f150ec143f6b074e3972ae4c24b557475f069293f8f47d5508133ba1f71a8aaca0974fb478a410637aae80e781b5c3deeabcda7156db730f6b46bb8
|
7
|
+
data.tar.gz: f46cd13c2bcad4649aaaef72982f24f0196a7b8110f8c81452a68a20395a049e7b5a8c08f75ebd11ba1c58b33ceaa920ad87d3ba95081c1e8f9201a4b122563c
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,27 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
-
## [2024-
|
5
|
+
## [0.1.3] - 2024-10-23
|
6
6
|
|
7
7
|
### Added
|
8
|
-
|
8
|
+
|
9
|
+
- Added support for Pundit::Context
|
10
|
+
- Using reissue for changelog and release management
|
11
|
+
|
12
|
+
## [0.1.2] - 2024-04-10
|
13
|
+
|
14
|
+
### Added
|
15
|
+
|
16
|
+
- Fixed the missing changelog information for the previous version.
|
17
|
+
|
18
|
+
## [0.1.1] - 2024-04-10
|
19
|
+
|
20
|
+
### Added
|
21
|
+
|
22
|
+
- Added params_for_action support in controller Authorization
|
23
|
+
|
24
|
+
## [0.1.0] - 2024-04-10
|
25
|
+
|
26
|
+
### Added
|
27
|
+
|
28
|
+
- Initial project setup with basic Pundit integration.
|
data/README.md
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
Add some extra features to Pundit.
|
4
4
|
|
5
|
+
- Custom exceptions
|
6
|
+
- Manage required or permitted params from within your policy classes
|
7
|
+
|
5
8
|
## Installation
|
6
9
|
|
7
10
|
Install the gem and add to the application's Gemfile by executing:
|
@@ -49,11 +52,21 @@ class MyPolicy < ApplicationPolicy
|
|
49
52
|
end
|
50
53
|
|
51
54
|
# Return the params for the action but require a special key
|
52
|
-
def
|
53
|
-
params_for(@record, params, :
|
55
|
+
def params_for_update(params)
|
56
|
+
params_for(@record, params, :update).tap do |params|
|
54
57
|
params.require(:special_key)
|
55
58
|
end
|
56
59
|
end
|
60
|
+
|
61
|
+
def permitted_attributes
|
62
|
+
%i[name other special_key]
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
class SomeController < ApplicationController
|
67
|
+
def update
|
68
|
+
@some_record.update(params_for_action(@some_record))
|
69
|
+
end
|
57
70
|
end
|
58
71
|
```
|
59
72
|
|
data/Rakefile
CHANGED
@@ -21,4 +21,9 @@ module Pundit
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
|
+
if Pundit.const_defined?(:Context)
|
26
|
+
Pundit::Context.prepend(Pundit::Plus::CustomException)
|
27
|
+
else
|
28
|
+
Pundit.singleton_class.prepend(Pundit::Plus::CustomException)
|
29
|
+
end
|
data/lib/pundit/plus/version.rb
CHANGED
data/lib/pundit/plus.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pundit-plus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Gay
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pundit
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
requirements: []
|
78
|
-
rubygems_version: 3.5.
|
78
|
+
rubygems_version: 3.5.9
|
79
79
|
signing_key:
|
80
80
|
specification_version: 4
|
81
81
|
summary: Pundit with additional features.
|