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
Permalink URLs for posts and private posts #301
Conversation
@@ -2,7 +2,8 @@ | |||
Thredded::Engine.routes.draw do | |||
resource :theme_preview, only: [:show], path: 'theme-preview' if %w(development test).include? Rails.env | |||
|
|||
page_constraint = { page: /[1-9]\d*/ } | |||
positive_int = /[1-9]\d*/ | |||
page_constraint = { page: positive_int } |
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.
love this
@@ -6,7 +6,8 @@ class Messageboard < ActiveRecord::Base | |||
use: [:slugged, :reserved], | |||
# Avoid route conflicts | |||
reserved_words: ::Thredded::FriendlyIdReservedWordsAndPagination.new( | |||
%w(messageboards preferences private-topics autocomplete-users theme-preview admin) | |||
%w(messageboards preferences private-topics private-posts posts autocomplete-users | |||
theme-preview admin) |
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.
This array has gotten big enough where it's a little bit of mental overhead to parse it on a quick look. Could you break these out into their own lines? It'd make diffs cleaner too.
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.
Good call, done.
Looks great @glebm - just a couple comments in there. |
Currently we send emails with the URL to the page of the topic where the post is at. However, when posts are deleted, the page may change. This introduces permalinks for posts and private posts that always redirect to the correct page.
Currently we send emails with the URL to the page of the topic where the
post is at. However, when posts are deleted the page may change.
This introduces permalinks for posts and private posts that always
redirect to the correct page.