diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index cb4acf487..ff3641ca8 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -9,7 +9,7 @@ class PostsController < ApplicationController rescue_from ActiveRecord::RecordNotFound, :with => :rescue_exception def index - @post_set = PostSets::Post.new(tag_query, params[:page], params[:limit] || CurrentUser.user.per_page) + @post_set = PostSets::Post.new(tag_query, params[:page], params[:limit] || CurrentUser.user.per_page, params[:raw]) @posts = @post_set.posts respond_with(@posts) do |format| format.atom diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index 216194cc2..4cbd53d00 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -1,12 +1,13 @@ module PostSets class Post < Base - attr_reader :tag_array, :page, :per_page + attr_reader :tag_array, :page, :per_page, :raw - def initialize(tags, page = 1, per_page = nil) + def initialize(tags, page = 1, per_page = nil, raw = false) @tag_array = Tag.scan_query(tags) @page = page @per_page = (per_page || CurrentUser.per_page).to_i @per_page = 200 if @per_page > 200 + @raw = raw.present? end def tag_string @@ -43,7 +44,11 @@ module PostSets end @posts ||= begin - temp = ::Post.tag_match(tag_string).paginate(page, :count => ::Post.fast_count(tag_string), :limit => per_page) + if raw + temp = ::Post.raw_tag_match(tag_string).paginate(page, :count => ::Post.fast_count(tag_string), :limit => per_page) + else + temp = ::Post.tag_match(tag_string).paginate(page, :count => ::Post.fast_count(tag_string), :limit => per_page) + end temp.all temp end diff --git a/app/views/tag_alias_corrections/show.html.erb b/app/views/tag_alias_corrections/show.html.erb index 54d0926be..cb986deca 100644 --- a/app/views/tag_alias_corrections/show.html.erb +++ b/app/views/tag_alias_corrections/show.html.erb @@ -6,7 +6,7 @@