Merge pull request #3740 from consul/remove_obsolete_code
Remove leftover code
This commit is contained in:
@@ -4,12 +4,12 @@ class Admin::TagsController < Admin::BaseController
|
||||
respond_to :html, :js
|
||||
|
||||
def index
|
||||
@tags = ActsAsTaggableOn::Tag.category.page(params[:page])
|
||||
@tag = ActsAsTaggableOn::Tag.category.new
|
||||
@tags = Tag.category.page(params[:page])
|
||||
@tag = Tag.category.new
|
||||
end
|
||||
|
||||
def create
|
||||
ActsAsTaggableOn::Tag.category.create(tag_params)
|
||||
Tag.category.create(tag_params)
|
||||
redirect_to admin_tags_path
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ class Admin::TagsController < Admin::BaseController
|
||||
end
|
||||
|
||||
def find_tag
|
||||
@tag = ActsAsTaggableOn::Tag.category.find(params[:id])
|
||||
@tag = Tag.category.find(params[:id])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -64,7 +64,7 @@ module Budgets
|
||||
end
|
||||
|
||||
def load_categories
|
||||
@categories = ActsAsTaggableOn::Tag.category.order(:name)
|
||||
@categories = Tag.category.order(:name)
|
||||
end
|
||||
|
||||
def load_ballot_referer
|
||||
|
||||
@@ -17,7 +17,6 @@ module Budgets
|
||||
load_and_authorize_resource :investment, through: :budget, class: "Budget::Investment",
|
||||
except: :json_data
|
||||
|
||||
before_action -> { flash.now[:notice] = flash[:notice].html_safe if flash[:html_safe] && flash[:notice] }
|
||||
before_action :load_ballot, only: [:index, :show]
|
||||
before_action :load_heading, only: [:index, :show]
|
||||
before_action :set_random_seed, only: :index
|
||||
@@ -147,7 +146,7 @@ module Budgets
|
||||
end
|
||||
|
||||
def load_categories
|
||||
@categories = ActsAsTaggableOn::Tag.category.order(:name)
|
||||
@categories = Tag.category.order(:name)
|
||||
end
|
||||
|
||||
def load_content_blocks
|
||||
|
||||
@@ -110,12 +110,12 @@ module CommentableActions
|
||||
end
|
||||
|
||||
def load_categories
|
||||
@categories = ActsAsTaggableOn::Tag.category.order(:name)
|
||||
@categories = Tag.category.order(:name)
|
||||
end
|
||||
|
||||
def parse_tag_filter
|
||||
if params[:tag].present?
|
||||
@tag_filter = params[:tag] if ActsAsTaggableOn::Tag.named(params[:tag]).exists?
|
||||
@tag_filter = params[:tag] if Tag.named(params[:tag]).exists?
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ class Management::Budgets::InvestmentsController < Management::BaseController
|
||||
end
|
||||
|
||||
def load_categories
|
||||
@categories = ActsAsTaggableOn::Tag.category.order(:name)
|
||||
@categories = Tag.category.order(:name)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
class SandboxController < ApplicationController
|
||||
skip_authorization_check
|
||||
|
||||
layout :set_layout
|
||||
|
||||
helper_method(:namespace)
|
||||
|
||||
def index
|
||||
@templates = Dir.glob(Rails.root.join("app", "views", "sandbox", "*.html.erb").to_s).map do |filename|
|
||||
filename = File.basename(filename, File.extname(filename))
|
||||
filename unless filename.starts_with?("_") || filename == "index.html"
|
||||
end.compact
|
||||
end
|
||||
|
||||
def show
|
||||
if params[:template].index(".") # CVE-2014-0130
|
||||
render action: "index"
|
||||
elsif lookup_context.exists?("sandbox/#{params[:template]}")
|
||||
if params[:template] == "index"
|
||||
render action: "index"
|
||||
else
|
||||
render "sandbox/#{params[:template]}"
|
||||
end
|
||||
|
||||
elsif lookup_context.exists?("sandbox/#{params[:template]}/index")
|
||||
render "sandbox/#{params[:template]}/index"
|
||||
else
|
||||
render action: "index"
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_layout
|
||||
if params[:template] && params[:template].split("_").first == "admin"
|
||||
"admin"
|
||||
else
|
||||
"application"
|
||||
end
|
||||
end
|
||||
|
||||
def namespace
|
||||
"admin"
|
||||
end
|
||||
end
|
||||
@@ -1,10 +1,10 @@
|
||||
class TagsController < ApplicationController
|
||||
|
||||
load_and_authorize_resource class: ActsAsTaggableOn::Tag
|
||||
load_and_authorize_resource
|
||||
respond_to :json
|
||||
|
||||
def suggest
|
||||
@tags = ActsAsTaggableOn::Tag.search(params[:search]).map(&:name)
|
||||
@tags = Tag.search(params[:search]).map(&:name)
|
||||
respond_with @tags
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user