I'm using the Rails gem, Public Activity and wanted to create an activity instance for every update
action but with a catch. I only want the event created if a certain attribute is changed. In my case it would be a post's time_zone
. Here is how activities are currently created in my posts controller:
class PostsController < ApplicationController
def update
...
@post.create_activity :update, owner: current_user
...
end
end
I couldn't find anything in the docs that explain how to do the aforementioned. Is there a way to setup, let's say a conditional that checks if the time_zone
has changed to make this happen?