added 260907 version of worker toolkit

This commit is contained in:
2026-09-08 20:30:51 -04:00
parent cbd3f0f8ca
commit 97aca37663
1283 changed files with 142951 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
class Comment
include Mongoid::Document
include Mongoid::Timestamps
include Usernameable
store_in collection: "postables"
field :body, type: String
field :_type, type: String, default: -> { self.class.name }
field :encrypted_user_id, type: String, encrypted: {type: :integer}
validates :body, :post, :encrypted_user_id, presence: true
belongs_to :post, index: true, counter_cache: true
has_many :reactions, as: :reactable, dependent: :destroy
has_many :notifications, as: :notificateable, dependent: :destroy
after_create { post.update(last_commented: Time.current) }
end