has_moderated 0.0.31 → 0.0.34
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.
- data/README.rdoc +14 -2
- data/lib/has_moderated/common.rb +17 -3
- data/lib/has_moderated/moderated_associations.rb +10 -0
- data/lib/has_moderated/moderation_model.rb +43 -0
- data/lib/has_moderated/version.rb +1 -1
- data/test/dummy/log/development.log +88 -0
- data/test/dummy/log/test.log +6534 -0
- data/test/dummy/spec/models/task_spec.rb +24 -0
- metadata +4 -4
|
@@ -245,4 +245,28 @@ describe Task do
|
|
|
245
245
|
st.title.should eq("Jo jo")
|
|
246
246
|
st.id.should eq(Subtask.first.id)
|
|
247
247
|
end
|
|
248
|
+
|
|
249
|
+
it "should moderate removing an association" do
|
|
250
|
+
t = Task.new :title => "Test"
|
|
251
|
+
t.subtasks.build :title => "HJoin"
|
|
252
|
+
t.subtasks.build :title => "HJoin2"
|
|
253
|
+
t.save
|
|
254
|
+
Moderation.last.accept
|
|
255
|
+
|
|
256
|
+
Task.count.should eq(1)
|
|
257
|
+
t = Task.first
|
|
258
|
+
t.subtasks.count.should eq(2)
|
|
259
|
+
|
|
260
|
+
first_subtask = t.subtasks.first
|
|
261
|
+
t.subtasks.delete(first_subtask)
|
|
262
|
+
|
|
263
|
+
t = Task.first
|
|
264
|
+
t.subtasks.count.should eq(2)
|
|
265
|
+
Moderation.count.should eq(1)
|
|
266
|
+
|
|
267
|
+
Moderation.last.accept
|
|
268
|
+
t = Task.first
|
|
269
|
+
t.subtasks.count.should eq(1)
|
|
270
|
+
t.subtasks.first.title.should_not eq(first_subtask.title)
|
|
271
|
+
end
|
|
248
272
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: has_moderated
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 91
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 0.0.
|
|
9
|
+
- 34
|
|
10
|
+
version: 0.0.34
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Jan Berdajs
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2012-
|
|
18
|
+
date: 2012-03-20 00:00:00 Z
|
|
19
19
|
dependencies:
|
|
20
20
|
- !ruby/object:Gem::Dependency
|
|
21
21
|
prerelease: false
|