Skip to content
mrbrdo edited this page Oct 14, 2012 · 8 revisions

To see pending moderations, simply call

Moderation.all

You can also see moderations for a specific record. For example, if you have Post model, you can call moderations on it.

post = Post.first
post.moderations

Moderation is a normal ActiveRecord model, you can inspect it in rails console to see what it holds. The data can be deserialized using YAML::load, but this has already been done for you

moderation.parsed_data

To accept a moderation, call

moderation.accept

The accept method will raise an exception (v1.0.1+) if model validations do not pass.

to discard (destroy) it, call

moderation.discard

Do not use moderation.destroy, because discard triggers certain callbacks which may be necessary.

Which kind of moderation is it?

You can call the following convenience methods to determine the type of moderation

moderation.create?
moderation.destroy?
moderation.update?