Limit how many messages a user can create

This commit is contained in:
Stanko K.R.
2025-08-14 16:31:52 +02:00
parent c40eae7d6d
commit cf50b46cd4
@@ -1,6 +1,8 @@
class Conversations::MessagesController < ApplicationController
before_action :set_conversation
rate_limit to: 5, within: 30.seconds, by: -> { Current.user.cache_key }, only: :create
def index
@messages = paginated_messages(@conversation.messages)
end