Class: Thredded::PostModerationRecord
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Thredded::PostModerationRecord
- Includes:
- ModerationState
- Defined in:
- app/models/thredded/post_moderation_record.rb
Class Method Summary collapse
-
.record!(moderator:, post:, previous_moderation_state:, moderation_state:) ⇒ Thredded::PostModerationRecord
The newly created persisted record.
Instance Method Summary collapse
-
#post_readers ⇒ ActiveRecord::Relation<Thredded.user_class>
Users that can read the moderated post.
Class Method Details
.record!(moderator:, post:, previous_moderation_state:, moderation_state:) ⇒ Thredded::PostModerationRecord
Returns the newly created persisted record.
63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'app/models/thredded/post_moderation_record.rb', line 63 def self.record!(moderator:, post:, previous_moderation_state:, moderation_state:) create!( previous_moderation_state: previous_moderation_state, moderation_state: moderation_state, moderator: moderator, post: post, post_content: post.content, post_user: post.user, post_user_name: post.user.try(:thredded_display_name), messageboard_id: post., ) end |
Instance Method Details
#post_readers ⇒ ActiveRecord::Relation<Thredded.user_class>
Returns users that can read the moderated post.
54 55 56 |
# File 'app/models/thredded/post_moderation_record.rb', line 54 def post_readers Thredded.user_class.([]) end |