FirehoseCommunity / DEFCON

6 stars 4 forks source link

Notify users of future comments #116

Closed jeffgerlach closed 8 years ago

jeffgerlach commented 8 years ago

To add the feature described in #90, I added a new boolean user field in the database post_interaction_notification, along with options to turn it on/off in the user dashboard. If this option is set to true, then when someone else comments on a post the user commented on, they will be notified via asynchronous email (using SuckerPunch).

I also implemented the comment notifications feature for the post creator, so unless they turn off the post_notifications boolean switch (in the dashboard), they will be notified whenever someone else comments on their posts. Both of these fields will default to true for new users.

Added tests to check mail creation and asynchronous queuing, and moved the post controller asynchronous email tests to the Post model tests since they didn't actually call any controller actions. Added link URLs to the notification emails (for both posts and comments), so I also added the default url to the test environment. Also removed post creator email from the notifications and replaced with their name (in case we want to hide emails). Think that's about it!

kenmazaika commented 8 years ago

Looks great! Only thing I see is that it has merge conflicts. Resolve those and I'll merge this in!

jeffgerlach commented 8 years ago

Merged with master (there were some inconsistencies in the schema.rb so I just re-generated it from scratch)

kenmazaika commented 8 years ago

The problems with schema are pretty common. The reason being, the order you ran the migrations (which could be different if you developed it on a branch), changes person-to-person.