-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add public-activity for tracking updates in publishable records #119
Conversation
553f50e
to
059bdbb
Compare
What should we do with bulk upload and bulk actions? Just one activity (disable that callback), or bunch of activities for each update. Something to consider. |
So on the other PR I mentioned a single activity, but I guess it will depend on how much they use it, maybe for now I'd keep with tracking all of the activities individually and if see how it looks. Otherwise we might need to tweak the display so that they can see exactly what was affected. |
One thing to add is the link to the resource, so that it's easy to go to that page and check. Other than that, this is what I wanted =D We might want to add pagination to the page, in case this grows quite large. |
This page could be a standard active admin index page, right? With filters, pagination, everything. Last activities could be another section that we will add to the dashboard. |
I'll get back to this tomorrow. |
74bcab5
to
1bfe537
Compare
Bulk updates are currently implemented using |
14ee3e0
to
f55cbca
Compare
rebased after #131 was merged |
CSV import will generate as many activities as there were updates, maybe to be consistent bulk update should also do the same? I'm not sure. |
|
||
return unless errors.blank? && previous_changes.present? | ||
|
||
create_activity activity_key_for_last_update, owner: owner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to manually create activities (for bulk updates, CSV imports) we could extract from here something like #create_activity_with_current_changes
:
module PublicActivityTrackable
# ..
def create_activity_with_current_changes!
# ..
create_activity activity_key_for_last_update, owner: owner
end
protected
def track_updates_activity
yield
create_activity_with_current_changes!
end
end
then for mentioned cases:
company.update_attributes()
company.create_activity_with_current_changes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could just start without using update_all
in batch actions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just update
and everything should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done in this way. Looks like it works as it should now I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Summary
Company, Geography, Legislation, Litigation, Target
resourcesvisibility_status
, deletes and all other "edits"