mirror of
https://github.com/discourse/discourse.git
synced 2025-06-10 05:23:44 +08:00
FIX: UserAction did not have a types enum (#10553)
This is important for Data Explorer to provide proper help text.
This commit is contained in:
@ -38,6 +38,23 @@ class UserAction < ActiveRecord::Base
|
|||||||
ASSIGNED,
|
ASSIGNED,
|
||||||
].each_with_index.to_a.flatten]
|
].each_with_index.to_a.flatten]
|
||||||
|
|
||||||
|
def self.types
|
||||||
|
@types ||= Enum.new(
|
||||||
|
like: 1,
|
||||||
|
was_liked: 2,
|
||||||
|
bookmark: 3,
|
||||||
|
new_topic: 4,
|
||||||
|
reply: 5,
|
||||||
|
response: 6,
|
||||||
|
mention: 7,
|
||||||
|
quote: 9,
|
||||||
|
edit: 11,
|
||||||
|
new_private_message: 12,
|
||||||
|
got_private_message: 13,
|
||||||
|
solved: 15,
|
||||||
|
assigned: 16)
|
||||||
|
end
|
||||||
|
|
||||||
def self.last_action_in_topic(user_id, topic_id)
|
def self.last_action_in_topic(user_id, topic_id)
|
||||||
UserAction.where(user_id: user_id,
|
UserAction.where(user_id: user_id,
|
||||||
target_topic_id: topic_id,
|
target_topic_id: topic_id,
|
||||||
|
Reference in New Issue
Block a user