protected_record 0.1.6 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -2
- data/lib/protected_record/change_log.rb +0 -1
- data/lib/protected_record/change_request.rb +0 -1
- data/lib/protected_record/version.rb +1 -1
- data/protected_record.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7df8821073837a50e376df9e7d671cfc9ff5258f
|
4
|
+
data.tar.gz: 4cdddffb1aa49bcd24999853dc2f24605da32e9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55ce83999758fe5a26355dcfe8e128ca226dc12c1ea616412ced8eee0e279574624a5bb2ac35114f9909af242398a3a5d20c0c84512cb6194c1c40cd95ef6270
|
7
|
+
data.tar.gz: c2dadf295a50e5646deaa6d6d65d3bc7af1869d0a577afccccff7982e27008e78e9594a791fe03b5cad9e7b85da6ace54650f6c40c6ba37a6f2dadf4265ade10
|
data/README.md
CHANGED
@@ -47,13 +47,13 @@ class SomeRecord < ActiveRecord::Base
|
|
47
47
|
end
|
48
48
|
```
|
49
49
|
|
50
|
-
Your third option is to omit `:protected_keys` entirely.
|
50
|
+
3. Your third option is to omit `:protected_keys` entirely.
|
51
51
|
If they are not specified using either method, ProtectedRecord will use an empty array.
|
52
52
|
|
53
53
|
## Usage & Function
|
54
54
|
|
55
55
|
1. protected_record will prevent changes to attributes you specify as protected.
|
56
|
-
2. Any attempted change will be logged as a
|
56
|
+
2. Any attempted but prevented change will be logged as a
|
57
57
|
`ProtectedRecord::ChangeRequest::Record`.
|
58
58
|
3. If any changes are allowed through the filter, protected_record
|
59
59
|
will create a `ProtectedRecord::ChangeLog::Record` to log who changed what,
|
@@ -92,6 +92,12 @@ and
|
|
92
92
|
@some_record.change_request_records
|
93
93
|
```
|
94
94
|
|
95
|
+
## Recent Changes
|
96
|
+
Okay, so not so recent. Rails 4 removed attr_accessible, which this gem was using.
|
97
|
+
The only change to the end user should be the need to whitelist any params using
|
98
|
+
[strong_parameters](https://github.com/rails/strong_parameters). Since this is technically
|
99
|
+
a breaking change, it's time to bump protected_record to v1.0.0.
|
100
|
+
|
95
101
|
## Contributing
|
96
102
|
|
97
103
|
Please do. There's plenty that could be done to round out both the interface
|
@@ -3,7 +3,6 @@ module ProtectedRecord
|
|
3
3
|
module ChangeLog
|
4
4
|
class Record < ActiveRecord::Base
|
5
5
|
self.table_name = "protected_record_change_log_records"
|
6
|
-
attr_accessible :recordable, :user
|
7
6
|
belongs_to :recordable, polymorphic: true
|
8
7
|
belongs_to :user, class_name: "User", foreign_key: :user_id
|
9
8
|
end
|
data/protected_record.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.require_paths = ["lib"]
|
27
27
|
|
28
28
|
s.add_runtime_dependency "pay_dirt", "~> 1.0.0"
|
29
|
-
s.add_runtime_dependency "activerecord", "
|
29
|
+
s.add_runtime_dependency "activerecord", "~> 4.0"
|
30
30
|
|
31
31
|
s.add_development_dependency "coveralls"
|
32
32
|
s.add_development_dependency "minitest"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protected_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tad Hosford
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '4.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '4.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: coveralls
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|