has_moderated 1.0.beta2 → 1.0.rc1

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 CHANGED
@@ -119,6 +119,14 @@ This will return the record with modified attributes, but not saved to database.
119
119
 
120
120
  Just be careful not to call record_preview.save, as this will create a new moderation record.
121
121
 
122
+ == Which kind of moderation is it?
123
+
124
+ You can call the following convenience methods to determine the type of moderation
125
+
126
+ moderation.create?
127
+ moderation.destroy?
128
+ moderation.update?
129
+
122
130
  == Bypassing moderation
123
131
  To bypass moderation (e.g. for admin users), wrap your code into without_moderation like so:
124
132
 
@@ -24,5 +24,17 @@ module HasModerated
24
24
  def preview
25
25
  HasModerated::ModeratedAttributes::ApplyModeration::apply(self, parsed_data, false)
26
26
  end
27
+
28
+ def create?
29
+ parsed_data[:create].present?
30
+ end
31
+
32
+ def destroy?
33
+ parsed_data.to_s == "destroy"
34
+ end
35
+
36
+ def update?
37
+ !(create? || destroy?)
38
+ end
27
39
  end
28
40
  end
@@ -1,3 +1,3 @@
1
1
  module HasModerated
2
- VERSION = "1.0.beta2"
2
+ VERSION = "1.0.rc1"
3
3
  end
@@ -7541,3 +7541,4 @@ Migrating to CreatePhotos (20120520215224)
7541
7541
   (0.0ms) PRAGMA index_list("task_photos")
7542
7542
   (0.0ms) PRAGMA index_list("tasks")
7543
7543
   (0.0ms) PRAGMA index_list("tasks_jointable")
7544
+ DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from /Users/apple/rails/has_moderated/test/dummy/config/environment.rb:5)