has_moderated 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
@@ -21,7 +21,7 @@ class Moderation < ActiveRecord::Base
|
|
21
21
|
end
|
22
22
|
# temporarily disable moderation check on save, and save updated record
|
23
23
|
rec.has_moderated_updating = true
|
24
|
-
rec.save
|
24
|
+
rec.save(:validate => false) # don't run validations
|
25
25
|
rec.has_moderated_updating = false
|
26
26
|
# case: moderated associations (existing record)
|
27
27
|
else
|
@@ -52,7 +52,7 @@ class Moderation < ActiveRecord::Base
|
|
52
52
|
arec.send(fk.to_s+"=", rec.id) # set association to the newly created record
|
53
53
|
# disable moderation for associated model (if enabled)
|
54
54
|
arec.has_moderated_updating = true if arec.respond_to?("has_moderated_updating=")
|
55
|
-
arec.save
|
55
|
+
arec.save(:validate => false) # don't run validations
|
56
56
|
arec.has_moderated_updating = false if arec.respond_to?("has_moderated_updating=")
|
57
57
|
end
|
58
58
|
end
|
@@ -64,7 +64,7 @@ class Moderation < ActiveRecord::Base
|
|
64
64
|
moderatable.has_moderated_updating = true
|
65
65
|
# bypass attr_accessible protection
|
66
66
|
moderatable.send(attr_name.to_s+"=", YAML::load(attr_value))
|
67
|
-
moderatable.save
|
67
|
+
moderatable.save(:validate => false) # don't run validations
|
68
68
|
moderatable.has_moderated_updating = false
|
69
69
|
self.destroy # destroy this moderation since it has been applied
|
70
70
|
end
|
@@ -21,7 +21,7 @@ class Moderation < ActiveRecord::Base
|
|
21
21
|
end
|
22
22
|
# temporarily disable moderation check on save, and save updated record
|
23
23
|
rec.has_moderated_updating = true
|
24
|
-
rec.save
|
24
|
+
rec.save(:validate => false) # don't run validations
|
25
25
|
rec.has_moderated_updating = false
|
26
26
|
# case: moderated associations (existing record)
|
27
27
|
else
|
@@ -52,7 +52,7 @@ class Moderation < ActiveRecord::Base
|
|
52
52
|
arec.send(fk.to_s+"=", rec.id) # set association to the newly created record
|
53
53
|
# disable moderation for associated model (if enabled)
|
54
54
|
arec.has_moderated_updating = true if arec.respond_to?("has_moderated_updating=")
|
55
|
-
arec.save
|
55
|
+
arec.save(:validate => false) # don't run validations
|
56
56
|
arec.has_moderated_updating = false if arec.respond_to?("has_moderated_updating=")
|
57
57
|
end
|
58
58
|
end
|
@@ -64,7 +64,7 @@ class Moderation < ActiveRecord::Base
|
|
64
64
|
moderatable.has_moderated_updating = true
|
65
65
|
# bypass attr_accessible protection
|
66
66
|
moderatable.send(attr_name.to_s+"=", YAML::load(attr_value))
|
67
|
-
moderatable.save
|
67
|
+
moderatable.save(:validate => false) # don't run validations
|
68
68
|
moderatable.has_moderated_updating = false
|
69
69
|
self.destroy # destroy this moderation since it has been applied
|
70
70
|
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: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 9
|
10
|
+
version: 0.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jan Berdajs
|