Skip to content
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

FEATURE: Show dismiss posts/topics buttons on category filtered lists #2908

Merged
merged 3 commits into from Oct 31, 2014
Merged

FEATURE: Show dismiss posts/topics buttons on category filtered lists #2908

merged 3 commits into from Oct 31, 2014

Conversation

cpradio
Copy link
Contributor

@cpradio cpradio commented Oct 23, 2014

FEATURE: Add Dismiss Posts/Topics button to Category filtered Unread View
image

@discoursebot
Copy link

You've signed the CLA, cpradio. Thank you! This pull request is ready for review.

@cpradio cpradio changed the title Show dismiss posts/topics buttons on category filtered lists FEATURE: Show dismiss posts/topics buttons on category filtered lists Oct 23, 2014
@coding-horror
Copy link
Contributor

Oh nice one cpradio!

On Oct 23, 2014, at 2:59 PM, discoursebot notifications@github.com wrote:

You've signed the CLA, cpradio. Thank you! This pull request is ready for review.


Reply to this email directly or view it on GitHub.

@cpradio
Copy link
Contributor Author

cpradio commented Oct 23, 2014

Thank you :)

@eviltrout
Copy link
Contributor

Thanks! I left a couple of small comments.

@cpradio
Copy link
Contributor Author

cpradio commented Oct 24, 2014

Comments applied. Thanks!

topic_ids = TopicQuery.unread_filter(tq.joined_topic_user).listable_topics.where('category_id = ?', params[:category_id]).pluck(:id)
else
topic_ids = TopicQuery.unread_filter(tq.joined_topic_user).listable_topics.pluck(:id)
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if params[:category_id]
+        topic_ids = TopicQuery.unread_filter(tq.joined_topic_user).listable_topics.where('category_id = ?', params[:category_id]).pluck(:id)
+      else
+        topic_ids = TopicQuery.unread_filter(tq.joined_topic_user).listable_topics.pluck(:id)
+      end

topics =  TopicQuery.unread_filter(tq.joined_topic_user).listable_topics
topics =  topics.where('category_id = ?', params[:category_id]) if params[:category_id]
topic_ids = topics.pluck(:id)

@SamSaffron
Copy link
Member

this change looks good, lets apply my comment and get it merged

@cpradio
Copy link
Contributor Author

cpradio commented Oct 30, 2014

Thanks @SamSaffron! As usual, you found a way to make my logic much cleaner. 👍
I'm slowly getting the hang of Ruby

@SamSaffron
Copy link
Member

looks good, thanks!

SamSaffron added a commit that referenced this pull request Oct 31, 2014
…gory

FEATURE: Show dismiss posts/topics buttons on category filtered lists
@SamSaffron SamSaffron merged commit bd78fca into discourse:master Oct 31, 2014
@cpradio cpradio deleted the pr-dismiss-posts-topics-on-category branch October 31, 2014 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants