Display "activity from past day" in a list at /subscriptions/digest #2027
Labels
enhancement
explains that the issue is to improve upon one of our existing features
help wanted
requires help by anyone willing to contribute
Ruby
Milestone
We have a new feature in the User model called
user.content_followed_in_past_period(time_period)
plots2/app/models/user.rb
Lines 313 to 315 in c6b2d34
Let's adjust this to be
user.content_followed_in_period(start, end)
so we can use it like:user.content_followed_in_period(Time.now - 1.day, Time.now)
And make it not use
self.node.where()
butNode.where()
so it returns /all/ content, not just the user's own content -- adjusting both the test and the model function, and the test description on this line:plots2/test/unit/user_test.rb
Lines 92 to 96 in 3db7e63
Follow-up task
Then, let's make a new controller method in https://github.com/publiclab/plots2/blob/master/app/controllers/subscription_controller.rb to display this content. It can just be in a table, like this template:
https://github.com/publiclab/plots2/blob/master/app/views/wiki/_wikis.html.erb
I'm not sure, but it may be possible to simply render that template with a collection, so the overall
/app/views/subscriptions/digest.html.erb
file could be just:And the controller method could be:
This may not work on the first try, but I'm happy to help troubleshoot!
Follow-up task
Then, let's make a method to send the digest in an email!
The text was updated successfully, but these errors were encountered: