Short answer: it depends. If you need only the most recent actions and donβt need to track the actions or the full activity feed function, SQL is the way to go. but if you see the need to do full activity, you can create a model for it.
We recently made a stream of activity in our project. This is how we modeled it
Class Activity belongs_to :user_activities
in answer_controller we do
Class AnswersController def create ... Activity.add(current_user, ActivityType::QUESTION_ANSWERED, @answer) ... end end
To get a list of recent actions from the user, we do
@activities = @user.activities
source share