forked from e621ng/e621ng
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
This commit is contained in:
parent
bc06f8cea2
commit
fc7d84affd
@ -118,9 +118,6 @@ Style/EmptyMethod:
|
|||||||
Style/FloatDivision:
|
Style/FloatDivision:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Style/FrozenStringLiteralComment:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Style/GuardClause:
|
Style/GuardClause:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
4
Gemfile
4
Gemfile
@ -1,4 +1,6 @@
|
|||||||
source 'https://rubygems.org/'
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
source "https://rubygems.org/"
|
||||||
|
|
||||||
gem "dotenv", require: "dotenv/load"
|
gem "dotenv", require: "dotenv/load"
|
||||||
|
|
||||||
|
2
Rakefile
2
Rakefile
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
||||||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module UserWarnable
|
module UserWarnable
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Admin
|
module Admin
|
||||||
class DangerZoneController < ApplicationController
|
class DangerZoneController < ApplicationController
|
||||||
before_action :admin_only
|
before_action :admin_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Admin
|
module Admin
|
||||||
class DashboardsController < ApplicationController
|
class DashboardsController < ApplicationController
|
||||||
before_action :admin_only
|
before_action :admin_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Admin
|
module Admin
|
||||||
class ExceptionsController < ApplicationController
|
class ExceptionsController < ApplicationController
|
||||||
before_action :admin_only
|
before_action :admin_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Admin
|
module Admin
|
||||||
class ReownerController < ApplicationController
|
class ReownerController < ApplicationController
|
||||||
before_action :is_bd_staff_only
|
before_action :is_bd_staff_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Admin
|
module Admin
|
||||||
class StaffNotesController < ApplicationController
|
class StaffNotesController < ApplicationController
|
||||||
before_action :can_view_staff_notes_only
|
before_action :can_view_staff_notes_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Admin
|
module Admin
|
||||||
class StuckDnpController < ApplicationController
|
class StuckDnpController < ApplicationController
|
||||||
before_action :admin_only
|
before_action :admin_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Admin
|
module Admin
|
||||||
class UsersController < ApplicationController
|
class UsersController < ApplicationController
|
||||||
before_action :admin_only
|
before_action :admin_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
class APIThrottled < Exception; end
|
class APIThrottled < Exception; end
|
||||||
class FeatureUnavailable < StandardError; end
|
class FeatureUnavailable < StandardError; end
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ArtistUrlsController < ApplicationController
|
class ArtistUrlsController < ApplicationController
|
||||||
respond_to :json, :html
|
respond_to :json, :html
|
||||||
before_action :member_only, except: [:index]
|
before_action :member_only, except: [:index]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ArtistVersionsController < ApplicationController
|
class ArtistVersionsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ArtistsController < ApplicationController
|
class ArtistsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
before_action :member_only, :except => [:index, :show, :show_or_new]
|
before_action :member_only, :except => [:index, :show, :show_or_new]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class BansController < ApplicationController
|
class BansController < ApplicationController
|
||||||
before_action :moderator_only, :except => [:show, :index]
|
before_action :moderator_only, :except => [:show, :index]
|
||||||
respond_to :html
|
respond_to :html
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class BlipsController < ApplicationController
|
class BlipsController < ApplicationController
|
||||||
class BlipTooOld < Exception ; end
|
class BlipTooOld < Exception ; end
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class BulkUpdateRequestsController < ApplicationController
|
class BulkUpdateRequestsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
before_action :member_only, except: [:index, :show]
|
before_action :member_only, except: [:index, :show]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class CommentVotesController < ApplicationController
|
class CommentVotesController < ApplicationController
|
||||||
respond_to :json
|
respond_to :json
|
||||||
respond_to :html, only: [:index]
|
respond_to :html, only: [:index]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class CommentsController < ApplicationController
|
class CommentsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
before_action :member_only, except: %i[index search show for_post]
|
before_action :member_only, except: %i[index search show for_post]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module DeferredPosts
|
module DeferredPosts
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class DeletedPostsController < ApplicationController
|
class DeletedPostsController < ApplicationController
|
||||||
respond_to :html
|
respond_to :html
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class DmailsController < ApplicationController
|
class DmailsController < ApplicationController
|
||||||
respond_to :html
|
respond_to :html
|
||||||
respond_to :json, except: %i[new create]
|
respond_to :json, except: %i[new create]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class DtextPreviewsController < ApplicationController
|
class DtextPreviewsController < ApplicationController
|
||||||
def create
|
def create
|
||||||
body = params[:body] || ""
|
body = params[:body] || ""
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class EditHistoriesController < ApplicationController
|
class EditHistoriesController < ApplicationController
|
||||||
respond_to :html
|
respond_to :html
|
||||||
before_action :moderator_only
|
before_action :moderator_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class EmailBlacklistsController < ApplicationController
|
class EmailBlacklistsController < ApplicationController
|
||||||
respond_to :html, :json, :js
|
respond_to :html, :json, :js
|
||||||
before_action :admin_only
|
before_action :admin_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class EmailsController < ApplicationController
|
class EmailsController < ApplicationController
|
||||||
respond_to :html
|
respond_to :html
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class FavoritesController < ApplicationController
|
class FavoritesController < ApplicationController
|
||||||
before_action :member_only, except: [:index]
|
before_action :member_only, except: [:index]
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ForumCategoriesController < ApplicationController
|
class ForumCategoriesController < ApplicationController
|
||||||
respond_to :html
|
respond_to :html
|
||||||
before_action :admin_only
|
before_action :admin_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ForumPostVotesController < ApplicationController
|
class ForumPostVotesController < ApplicationController
|
||||||
respond_to :json
|
respond_to :json
|
||||||
before_action :member_only
|
before_action :member_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ForumPostsController < ApplicationController
|
class ForumPostsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
before_action :member_only, :except => [:index, :show, :search]
|
before_action :member_only, :except => [:index, :show, :search]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ForumTopicsController < ApplicationController
|
class ForumTopicsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
before_action :member_only, :except => [:index, :show]
|
before_action :member_only, :except => [:index, :show]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class HelpController < ApplicationController
|
class HelpController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
helper :wiki_pages
|
helper :wiki_pages
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class IpBansController < ApplicationController
|
class IpBansController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
before_action :admin_only
|
before_action :admin_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class IqdbQueriesController < ApplicationController
|
class IqdbQueriesController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
# Show uses POST because it needs a file parameter. This would be GET otherwise.
|
# Show uses POST because it needs a file parameter. This would be GET otherwise.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Maintenance
|
module Maintenance
|
||||||
module User
|
module User
|
||||||
class ApiKeysController < ApplicationController
|
class ApiKeysController < ApplicationController
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Maintenance
|
module Maintenance
|
||||||
module User
|
module User
|
||||||
class CountFixesController < ApplicationController
|
class CountFixesController < ApplicationController
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Maintenance
|
module Maintenance
|
||||||
module User
|
module User
|
||||||
class DeletionsController < ApplicationController
|
class DeletionsController < ApplicationController
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Maintenance
|
module Maintenance
|
||||||
module User
|
module User
|
||||||
class DmailFiltersController < ApplicationController
|
class DmailFiltersController < ApplicationController
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Maintenance
|
module Maintenance
|
||||||
module User
|
module User
|
||||||
class EmailChangesController < ApplicationController
|
class EmailChangesController < ApplicationController
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Maintenance
|
module Maintenance
|
||||||
module User
|
module User
|
||||||
class EmailNotificationsController < ApplicationController
|
class EmailNotificationsController < ApplicationController
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Maintenance
|
module Maintenance
|
||||||
module User
|
module User
|
||||||
class LoginRemindersController < ApplicationController
|
class LoginRemindersController < ApplicationController
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Maintenance
|
module Maintenance
|
||||||
module User
|
module User
|
||||||
class PasswordResetsController < ApplicationController
|
class PasswordResetsController < ApplicationController
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Maintenance
|
module Maintenance
|
||||||
module User
|
module User
|
||||||
class PasswordsController < ApplicationController
|
class PasswordsController < ApplicationController
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class MascotsController < ApplicationController
|
class MascotsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
before_action :admin_only, except: [:index]
|
before_action :admin_only, except: [:index]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class MetaSearchesController < ApplicationController
|
class MetaSearchesController < ApplicationController
|
||||||
def tags
|
def tags
|
||||||
@meta_search = MetaSearches::Tag.new(params)
|
@meta_search = MetaSearches::Tag.new(params)
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ModActionsController < ApplicationController
|
class ModActionsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Moderator
|
module Moderator
|
||||||
class DashboardsController < ApplicationController
|
class DashboardsController < ApplicationController
|
||||||
before_action :janitor_only
|
before_action :janitor_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Moderator
|
module Moderator
|
||||||
class IpAddrsController < ApplicationController
|
class IpAddrsController < ApplicationController
|
||||||
before_action :admin_only
|
before_action :admin_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Moderator
|
module Moderator
|
||||||
module Post
|
module Post
|
||||||
class ApprovalsController < ApplicationController
|
class ApprovalsController < ApplicationController
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Moderator
|
module Moderator
|
||||||
module Post
|
module Post
|
||||||
class DisapprovalsController < ApplicationController
|
class DisapprovalsController < ApplicationController
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Moderator
|
module Moderator
|
||||||
module Post
|
module Post
|
||||||
class PostsController < ApplicationController
|
class PostsController < ApplicationController
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class NewsUpdatesController < ApplicationController
|
class NewsUpdatesController < ApplicationController
|
||||||
before_action :admin_only, except: [:index]
|
before_action :admin_only, except: [:index]
|
||||||
respond_to :html
|
respond_to :html
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class NotePreviewsController < ApplicationController
|
class NotePreviewsController < ApplicationController
|
||||||
respond_to :json
|
respond_to :json
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class NoteVersionsController < ApplicationController
|
class NoteVersionsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class NotesController < ApplicationController
|
class NotesController < ApplicationController
|
||||||
respond_to :html, :json, :js
|
respond_to :html, :json, :js
|
||||||
before_action :member_only, :except => [:index, :show, :search]
|
before_action :member_only, :except => [:index, :show, :search]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PoolElementsController < ApplicationController
|
class PoolElementsController < ApplicationController
|
||||||
respond_to :html, :json, :js
|
respond_to :html, :json, :js
|
||||||
before_action :member_only
|
before_action :member_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PoolOrdersController < ApplicationController
|
class PoolOrdersController < ApplicationController
|
||||||
respond_to :html, :json, :js
|
respond_to :html, :json, :js
|
||||||
before_action :member_only
|
before_action :member_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PoolVersionsController < ApplicationController
|
class PoolVersionsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
before_action :member_only
|
before_action :member_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PoolsController < ApplicationController
|
class PoolsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
before_action :member_only, :except => [:index, :show, :gallery]
|
before_action :member_only, :except => [:index, :show, :gallery]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PopularController < ApplicationController
|
class PopularController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PostApprovalsController < ApplicationController
|
class PostApprovalsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PostEventsController < ApplicationController
|
class PostEventsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PostFavoritesController < ApplicationController
|
class PostFavoritesController < ApplicationController
|
||||||
respond_to :html
|
respond_to :html
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PostFlagsController < ApplicationController
|
class PostFlagsController < ApplicationController
|
||||||
before_action :member_only, :except => [:index, :show]
|
before_action :member_only, :except => [:index, :show]
|
||||||
before_action :janitor_only, only: [:destroy]
|
before_action :janitor_only, only: [:destroy]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PostReplacementsController < ApplicationController
|
class PostReplacementsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
before_action :member_only, only: [:create, :new]
|
before_action :member_only, only: [:create, :new]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PostReportReasonsController < ApplicationController
|
class PostReportReasonsController < ApplicationController
|
||||||
respond_to :html
|
respond_to :html
|
||||||
before_action :admin_only
|
before_action :admin_only
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PostSetMaintainersController < ApplicationController
|
class PostSetMaintainersController < ApplicationController
|
||||||
respond_to :html
|
respond_to :html
|
||||||
respond_to :js, except: [:index]
|
respond_to :js, except: [:index]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PostSetsController < ApplicationController
|
class PostSetsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
before_action :member_only, except: [:index, :show]
|
before_action :member_only, except: [:index, :show]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PostVersionsController < ApplicationController
|
class PostVersionsController < ApplicationController
|
||||||
before_action :member_only, except: [:index]
|
before_action :member_only, except: [:index]
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PostVotesController < ApplicationController
|
class PostVotesController < ApplicationController
|
||||||
before_action :member_only
|
before_action :member_only
|
||||||
before_action :moderator_only, only: [:index, :lock]
|
before_action :moderator_only, only: [:index, :lock]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PostsController < ApplicationController
|
class PostsController < ApplicationController
|
||||||
before_action :member_only, except: %i[show show_seq index random]
|
before_action :member_only, except: %i[show show_seq index random]
|
||||||
before_action :admin_only, only: [:update_iqdb]
|
before_action :admin_only, only: [:update_iqdb]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class RelatedTagsController < ApplicationController
|
class RelatedTagsController < ApplicationController
|
||||||
respond_to :json, :html, only: [:show]
|
respond_to :json, :html, only: [:show]
|
||||||
respond_to :json, only: [:bulk]
|
respond_to :json, only: [:bulk]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class SessionsController < ApplicationController
|
class SessionsController < ApplicationController
|
||||||
def new
|
def new
|
||||||
@user = User.new
|
@user = User.new
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class StaticController < ApplicationController
|
class StaticController < ApplicationController
|
||||||
def privacy
|
def privacy
|
||||||
@page = WikiPage.find_by(title: "e621:privacy_policy")
|
@page = WikiPage.find_by(title: "e621:privacy_policy")
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class StatsController < ApplicationController
|
class StatsController < ApplicationController
|
||||||
respond_to :html
|
respond_to :html
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class TagAliasRequestsController < ApplicationController
|
class TagAliasRequestsController < ApplicationController
|
||||||
before_action :member_only
|
before_action :member_only
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class TagAliasesController < ApplicationController
|
class TagAliasesController < ApplicationController
|
||||||
before_action :admin_only, except: [:index, :show, :destroy]
|
before_action :admin_only, except: [:index, :show, :destroy]
|
||||||
respond_to :html, :json, :js
|
respond_to :html, :json, :js
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class TagCorrectionsController < ApplicationController
|
class TagCorrectionsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
before_action :janitor_only, only: [:new, :create]
|
before_action :janitor_only, only: [:new, :create]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class TagImplicationRequestsController < ApplicationController
|
class TagImplicationRequestsController < ApplicationController
|
||||||
before_action :member_only
|
before_action :member_only
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class TagImplicationsController < ApplicationController
|
class TagImplicationsController < ApplicationController
|
||||||
before_action :admin_only, except: [:index, :show, :destroy]
|
before_action :admin_only, except: [:index, :show, :destroy]
|
||||||
respond_to :html, :json, :js
|
respond_to :html, :json, :js
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class TagTypeVersionsController < ApplicationController
|
class TagTypeVersionsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class TagsController < ApplicationController
|
class TagsController < ApplicationController
|
||||||
before_action :member_only, :only => [:edit, :update, :preview]
|
before_action :member_only, :only => [:edit, :update, :preview]
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class TakedownsController < ApplicationController
|
class TakedownsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
before_action :can_handle_takedowns_only, only: %i[update edit destroy add_by_ids add_by_tags count_matching_posts remove_by_ids]
|
before_action :can_handle_takedowns_only, only: %i[update edit destroy add_by_ids add_by_tags count_matching_posts remove_by_ids]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class TicketsController < ApplicationController
|
class TicketsController < ApplicationController
|
||||||
respond_to :html
|
respond_to :html
|
||||||
before_action :member_only, except: [:index]
|
before_action :member_only, except: [:index]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class UploadWhitelistsController < ApplicationController
|
class UploadWhitelistsController < ApplicationController
|
||||||
respond_to :html, :json, :js
|
respond_to :html, :json, :js
|
||||||
before_action :admin_only, only: [:new, :create, :edit, :update, :destroy]
|
before_action :admin_only, only: [:new, :create, :edit, :update, :destroy]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class UploadsController < ApplicationController
|
class UploadsController < ApplicationController
|
||||||
before_action :member_only
|
before_action :member_only
|
||||||
before_action :janitor_only, only: [:index, :show]
|
before_action :janitor_only, only: [:index, :show]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class UserFeedbacksController < ApplicationController
|
class UserFeedbacksController < ApplicationController
|
||||||
before_action :moderator_only, :only => [:new, :edit, :create, :update, :destroy]
|
before_action :moderator_only, :only => [:new, :edit, :create, :update, :destroy]
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class UserNameChangeRequestsController < ApplicationController
|
class UserNameChangeRequestsController < ApplicationController
|
||||||
before_action :member_only, only: [:new, :create, :show]
|
before_action :member_only, only: [:new, :create, :show]
|
||||||
before_action :moderator_only, only: :index
|
before_action :moderator_only, only: :index
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class UserRevertsController < ApplicationController
|
class UserRevertsController < ApplicationController
|
||||||
before_action :moderator_only
|
before_action :moderator_only
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class UsersController < ApplicationController
|
class UsersController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
skip_before_action :api_check
|
skip_before_action :api_check
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class WikiPageVersionsController < ApplicationController
|
class WikiPageVersionsController < ApplicationController
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class WikiPagesController < ApplicationController
|
class WikiPagesController < ApplicationController
|
||||||
respond_to :html, :json, :js
|
respond_to :html, :json, :js
|
||||||
before_action :member_only, :except => [:index, :search, :show, :show_or_new]
|
before_action :member_only, :except => [:index, :search, :show, :show_or_new]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ApplicationDecorator < Draper::Decorator
|
class ApplicationDecorator < Draper::Decorator
|
||||||
# NOTE: This is required for correct serialization of member models, otherwise hidden_attributes is ignored!!!
|
# NOTE: This is required for correct serialization of member models, otherwise hidden_attributes is ignored!!!
|
||||||
delegate :as_json, :serializable_hash
|
delegate :as_json, :serializable_hash
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ModActionDecorator < ApplicationDecorator
|
class ModActionDecorator < ApplicationDecorator
|
||||||
def self.collection_decorator_class
|
def self.collection_decorator_class
|
||||||
PaginatedDecorator
|
PaginatedDecorator
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PaginatedDecorator < Draper::CollectionDecorator
|
class PaginatedDecorator < Draper::CollectionDecorator
|
||||||
delegate :current_page, :total_pages, :is_first_page?, :is_last_page?, :pagination_mode, :max_numbered_pages, :records, :total_count
|
delegate :current_page, :total_pages, :is_first_page?, :is_last_page?, :pagination_mode, :max_numbered_pages, :records, :total_count
|
||||||
end
|
end
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PostEventDecorator < ApplicationDecorator
|
class PostEventDecorator < ApplicationDecorator
|
||||||
def self.collection_decorator_class
|
def self.collection_decorator_class
|
||||||
PaginatedDecorator
|
PaginatedDecorator
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class PostsDecorator < ApplicationDecorator
|
class PostsDecorator < ApplicationDecorator
|
||||||
def self.collection_decorator_class
|
def self.collection_decorator_class
|
||||||
PaginatedDecorator
|
PaginatedDecorator
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Admin::UsersHelper
|
module Admin::UsersHelper
|
||||||
def user_level_select(object, field)
|
def user_level_select(object, field)
|
||||||
options = Danbooru.config.levels.map { |x,y| [x,y] }
|
options = Danbooru.config.levels.map { |x,y| [x,y] }
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
def disable_mobile_mode?
|
def disable_mobile_mode?
|
||||||
if CurrentUser.user.present? && CurrentUser.is_member?
|
if CurrentUser.user.present? && CurrentUser.is_member?
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user