the_moderator 0.1.1 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.travis.yml +5 -0
- data/README.md +2 -0
- data/config.ru +9 -0
- data/lib/the_moderator/moderation_model.rb +1 -1
- data/lib/the_moderator/version.rb +1 -1
- data/spec/internal/app/assets/config/manifest.js +0 -0
- data/spec/internal/config/routes.rb +3 -1
- data/spec/internal/config/storage.yml +3 -0
- data/spec/internal/db/schema.rb +5 -0
- data/spec/internal/public/favicon.ico +0 -0
- data/spec/spec_helper.rb +0 -1
- data/spec/the_moderator/model_spec.rb +6 -6
- data/spec/the_moderator/moderation_model_spec.rb +5 -5
- data/the_moderator.gemspec +7 -7
- metadata +28 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1a98b30e2905b72202c7c07921f97b74c0f6330d237b25296d44cb3598927935
|
4
|
+
data.tar.gz: 17f489a1182ffb88de3637756e77b74238a1d72d39bada010323cce72af0c255
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ead49d4598d5521f4a5656f7dae06868ed5b9eb0decb5df1e07a43931f1af8659d326fe0e52e488d95616c4ed459839a3cc32a34f0eb286658b3e09ea8346fa4
|
7
|
+
data.tar.gz: 86c1d6c171fd2d49f58fb34df6909573e3ab7c0e954e11d87cba05011eff3797679aca961121e31d64ce0ee515a9722c00229d39d8ff37076b591c743bd364de
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# TheModerator
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/gdott9/the_moderator.svg?branch=master)](https://travis-ci.org/gdott9/the_moderator)
|
4
|
+
|
3
5
|
Moderate fields before their insertion in the database by serializing and saving them into a separate 'moderations' table.
|
4
6
|
|
5
7
|
## Installation
|
data/config.ru
ADDED
File without changes
|
data/spec/internal/db/schema.rb
CHANGED
File without changes
|
data/spec/spec_helper.rb
CHANGED
@@ -6,7 +6,7 @@ describe TheModerator::Model do
|
|
6
6
|
page = Page.new(name: 'Name', content: 'Content')
|
7
7
|
page.moderate(:name)
|
8
8
|
|
9
|
-
expect(page.moderations).to
|
9
|
+
expect(page.moderations.size).to eq(1)
|
10
10
|
expect(page.moderations.first.data[:attributes]).to include(name: 'Name')
|
11
11
|
expect(page.name).to be_nil
|
12
12
|
expect(page.content).to eq('Content')
|
@@ -14,14 +14,14 @@ describe TheModerator::Model do
|
|
14
14
|
|
15
15
|
it 'moderates association fields' do
|
16
16
|
category = Category.new(name: 'category')
|
17
|
-
category.
|
17
|
+
category.build_page
|
18
18
|
category.save
|
19
19
|
|
20
20
|
category.attributes = {page_attributes: {
|
21
21
|
name: 'name', content: 'content', id: category.page.id}}
|
22
22
|
category.moderate(page: :name)
|
23
23
|
|
24
|
-
expect(category.moderations).to
|
24
|
+
expect(category.moderations.size).to eq(1)
|
25
25
|
expect(category.moderations.first.data[:attributes])
|
26
26
|
.to include(page_attributes: {name: 'name', id: category.page.id})
|
27
27
|
expect(category.page.name).to be_nil
|
@@ -35,7 +35,7 @@ describe TheModerator::Model do
|
|
35
35
|
page.attributes = {links_attributes: [{id: link.id, name: 'link'}]}
|
36
36
|
page.moderate(links: [:name])
|
37
37
|
|
38
|
-
expect(page.moderations).to
|
38
|
+
expect(page.moderations.size).to eq(1)
|
39
39
|
expect(page.moderations.first.data[:attributes])
|
40
40
|
.to include(links_attributes: {link.id => {name: 'link', id: link.id}})
|
41
41
|
expect(link.name).to be_nil
|
@@ -47,8 +47,8 @@ describe TheModerator::Model do
|
|
47
47
|
page = Page.new(name: 'Name', content: 'Content')
|
48
48
|
page.moderate(:name)
|
49
49
|
|
50
|
-
expect(page.moderated?(:name)).to
|
51
|
-
expect(page.moderated?(:content)).to
|
50
|
+
expect(page.moderated?(:name)).to be true
|
51
|
+
expect(page.moderated?(:content)).to be false
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -15,7 +15,7 @@ describe TheModerator::ModerationModel do
|
|
15
15
|
subject.accept
|
16
16
|
|
17
17
|
expect(subject.moderatable.name).to eq('Name')
|
18
|
-
expect(subject.destroyed?).to
|
18
|
+
expect(subject.destroyed?).to be true
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -25,7 +25,7 @@ describe TheModerator::ModerationModel do
|
|
25
25
|
subject.discard
|
26
26
|
|
27
27
|
expect(subject.moderatable.name).to be_nil
|
28
|
-
expect(subject.destroyed?).to
|
28
|
+
expect(subject.destroyed?).to be true
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -34,15 +34,15 @@ describe TheModerator::ModerationModel do
|
|
34
34
|
expect(subject.moderatable.name).to be_nil
|
35
35
|
preview = subject.preview
|
36
36
|
|
37
|
-
expect(preview.frozen?).to
|
37
|
+
expect(preview.frozen?).to be true
|
38
38
|
expect(preview.name).to eq('Name')
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
describe '#include?' do
|
43
43
|
it 'includes name' do
|
44
|
-
expect(subject.include?(:name)).to
|
45
|
-
expect(subject.include?(:content)).to
|
44
|
+
expect(subject.include?(:name)).to be true
|
45
|
+
expect(subject.include?(:content)).to be false
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
data/the_moderator.gemspec
CHANGED
@@ -18,14 +18,14 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "activemodel", ">= 3.2.0", "<
|
22
|
-
spec.add_dependency "activerecord", ">= 3.2.0", "<
|
23
|
-
spec.add_dependency "activesupport", ">= 3.2.0", "<
|
21
|
+
spec.add_dependency "activemodel", ">= 3.2.0", "< 8"
|
22
|
+
spec.add_dependency "activerecord", ">= 3.2.0", "< 8"
|
23
|
+
spec.add_dependency "activesupport", ">= 3.2.0", "< 8"
|
24
24
|
|
25
|
-
spec.add_development_dependency "bundler", "~>
|
26
|
-
spec.add_development_dependency "rake", "~>
|
25
|
+
spec.add_development_dependency "bundler", "~> 2.2"
|
26
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
27
27
|
|
28
|
-
spec.add_development_dependency "rspec", "~>
|
29
|
-
spec.add_development_dependency "combustion", "~>
|
28
|
+
spec.add_development_dependency "rspec", "~> 3.10"
|
29
|
+
spec.add_development_dependency "combustion", "~> 1.3"
|
30
30
|
spec.add_development_dependency "sqlite3", "~> 1.3"
|
31
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: the_moderator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillaume DOTT
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: 3.2.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '8'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: 3.2.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '8'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: activerecord
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
version: 3.2.0
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
42
|
+
version: '8'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,7 +49,7 @@ dependencies:
|
|
49
49
|
version: 3.2.0
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
52
|
+
version: '8'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: activesupport
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
version: 3.2.0
|
60
60
|
- - "<"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
62
|
+
version: '8'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -69,63 +69,63 @@ dependencies:
|
|
69
69
|
version: 3.2.0
|
70
70
|
- - "<"
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: '
|
72
|
+
version: '8'
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: bundler
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
76
76
|
requirements:
|
77
77
|
- - "~>"
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
version: '
|
79
|
+
version: '2.2'
|
80
80
|
type: :development
|
81
81
|
prerelease: false
|
82
82
|
version_requirements: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
84
|
- - "~>"
|
85
85
|
- !ruby/object:Gem::Version
|
86
|
-
version: '
|
86
|
+
version: '2.2'
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
88
|
name: rake
|
89
89
|
requirement: !ruby/object:Gem::Requirement
|
90
90
|
requirements:
|
91
91
|
- - "~>"
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: '
|
93
|
+
version: '13.0'
|
94
94
|
type: :development
|
95
95
|
prerelease: false
|
96
96
|
version_requirements: !ruby/object:Gem::Requirement
|
97
97
|
requirements:
|
98
98
|
- - "~>"
|
99
99
|
- !ruby/object:Gem::Version
|
100
|
-
version: '
|
100
|
+
version: '13.0'
|
101
101
|
- !ruby/object:Gem::Dependency
|
102
102
|
name: rspec
|
103
103
|
requirement: !ruby/object:Gem::Requirement
|
104
104
|
requirements:
|
105
105
|
- - "~>"
|
106
106
|
- !ruby/object:Gem::Version
|
107
|
-
version: '
|
107
|
+
version: '3.10'
|
108
108
|
type: :development
|
109
109
|
prerelease: false
|
110
110
|
version_requirements: !ruby/object:Gem::Requirement
|
111
111
|
requirements:
|
112
112
|
- - "~>"
|
113
113
|
- !ruby/object:Gem::Version
|
114
|
-
version: '
|
114
|
+
version: '3.10'
|
115
115
|
- !ruby/object:Gem::Dependency
|
116
116
|
name: combustion
|
117
117
|
requirement: !ruby/object:Gem::Requirement
|
118
118
|
requirements:
|
119
119
|
- - "~>"
|
120
120
|
- !ruby/object:Gem::Version
|
121
|
-
version: '
|
121
|
+
version: '1.3'
|
122
122
|
type: :development
|
123
123
|
prerelease: false
|
124
124
|
version_requirements: !ruby/object:Gem::Requirement
|
125
125
|
requirements:
|
126
126
|
- - "~>"
|
127
127
|
- !ruby/object:Gem::Version
|
128
|
-
version: '
|
128
|
+
version: '1.3'
|
129
129
|
- !ruby/object:Gem::Dependency
|
130
130
|
name: sqlite3
|
131
131
|
requirement: !ruby/object:Gem::Requirement
|
@@ -149,10 +149,12 @@ extra_rdoc_files: []
|
|
149
149
|
files:
|
150
150
|
- ".gitignore"
|
151
151
|
- ".rspec"
|
152
|
+
- ".travis.yml"
|
152
153
|
- Gemfile
|
153
154
|
- LICENSE.txt
|
154
155
|
- README.md
|
155
156
|
- Rakefile
|
157
|
+
- config.ru
|
156
158
|
- lib/generators/the_moderator/install/USAGE
|
157
159
|
- lib/generators/the_moderator/install/install_generator.rb
|
158
160
|
- lib/generators/the_moderator/install/templates/migration.rb
|
@@ -162,14 +164,17 @@ files:
|
|
162
164
|
- lib/the_moderator/model.rb
|
163
165
|
- lib/the_moderator/moderation_model.rb
|
164
166
|
- lib/the_moderator/version.rb
|
167
|
+
- spec/internal/app/assets/config/manifest.js
|
165
168
|
- spec/internal/app/models/category.rb
|
166
169
|
- spec/internal/app/models/link.rb
|
167
170
|
- spec/internal/app/models/moderation.rb
|
168
171
|
- spec/internal/app/models/page.rb
|
169
172
|
- spec/internal/config/database.yml
|
170
173
|
- spec/internal/config/routes.rb
|
174
|
+
- spec/internal/config/storage.yml
|
171
175
|
- spec/internal/db/schema.rb
|
172
176
|
- spec/internal/log/.gitignore
|
177
|
+
- spec/internal/public/favicon.ico
|
173
178
|
- spec/spec_helper.rb
|
174
179
|
- spec/the_moderator/model_spec.rb
|
175
180
|
- spec/the_moderator/moderation_model_spec.rb
|
@@ -178,7 +183,7 @@ homepage: https://github.com/gdott9/the_moderator
|
|
178
183
|
licenses:
|
179
184
|
- MIT
|
180
185
|
metadata: {}
|
181
|
-
post_install_message:
|
186
|
+
post_install_message:
|
182
187
|
rdoc_options: []
|
183
188
|
require_paths:
|
184
189
|
- lib
|
@@ -193,21 +198,23 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
198
|
- !ruby/object:Gem::Version
|
194
199
|
version: '0'
|
195
200
|
requirements: []
|
196
|
-
|
197
|
-
|
198
|
-
signing_key:
|
201
|
+
rubygems_version: 3.2.29
|
202
|
+
signing_key:
|
199
203
|
specification_version: 4
|
200
204
|
summary: Moderate fields before their insertion in the database by serializing and
|
201
205
|
saving them into a separate 'moderations' table.
|
202
206
|
test_files:
|
207
|
+
- spec/internal/app/assets/config/manifest.js
|
203
208
|
- spec/internal/app/models/category.rb
|
204
209
|
- spec/internal/app/models/link.rb
|
205
210
|
- spec/internal/app/models/moderation.rb
|
206
211
|
- spec/internal/app/models/page.rb
|
207
212
|
- spec/internal/config/database.yml
|
208
213
|
- spec/internal/config/routes.rb
|
214
|
+
- spec/internal/config/storage.yml
|
209
215
|
- spec/internal/db/schema.rb
|
210
216
|
- spec/internal/log/.gitignore
|
217
|
+
- spec/internal/public/favicon.ico
|
211
218
|
- spec/spec_helper.rb
|
212
219
|
- spec/the_moderator/model_spec.rb
|
213
220
|
- spec/the_moderator/moderation_model_spec.rb
|