fixes #2133
This commit is contained in:
@@ -23,7 +23,7 @@ module Danbooru
|
||||
|
||||
%w(execute select_value select_values select_all).each do |method_name|
|
||||
define_method("#{method_name}_sql") do |sql, *params|
|
||||
connection.__send__(method_name, self.class.sanitize_sql_array([sql, *params]))
|
||||
self.class.connection.__send__(method_name, self.class.sanitize_sql_array([sql, *params]))
|
||||
end
|
||||
|
||||
self.class.__send__(:define_method, "#{method_name}_sql") do |sql, *params|
|
||||
|
||||
3
config/initializers/cookies_serializer.rb
Normal file
3
config/initializers/cookies_serializer.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
Rails.application.config.action_dispatch.cookies_serializer = :json
|
||||
@@ -23,3 +23,9 @@ end
|
||||
class String
|
||||
include Danbooru::Extensions::String
|
||||
end
|
||||
|
||||
class FalseClass
|
||||
def to_i
|
||||
0
|
||||
end
|
||||
end
|
||||
|
||||
4
config/initializers/filter_parameter_logging.rb
Normal file
4
config/initializers/filter_parameter_logging.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Configure sensitive parameters which will be filtered from the log file.
|
||||
Rails.application.config.filter_parameters += [:password]
|
||||
@@ -1,15 +1,16 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Add new inflection rules using the following format
|
||||
# (all these examples are active by default):
|
||||
# ActiveSupport::Inflector.inflections do |inflect|
|
||||
# Add new inflection rules using the following format. Inflections
|
||||
# are locale specific, and you may define rules for as many different
|
||||
# locales as you wish. All of these examples are active by default:
|
||||
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||
# inflect.plural /^(ox)$/i, '\1en'
|
||||
# inflect.singular /^(ox)en/i, '\1'
|
||||
# inflect.irregular 'person', 'people'
|
||||
# inflect.uncountable %w( fish sheep )
|
||||
# end
|
||||
#
|
||||
|
||||
# These inflection rules are supported but not enabled by default:
|
||||
# ActiveSupport::Inflector.inflections do |inflect|
|
||||
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||
# inflect.acronym 'RESTful'
|
||||
# end
|
||||
|
||||
@@ -2,4 +2,3 @@
|
||||
|
||||
# Add new mime types for use in respond_to blocks:
|
||||
# Mime::Type.register "text/richtext", :rtf
|
||||
# Mime::Type.register_alias "text/html", :iphone
|
||||
|
||||
@@ -2,8 +2,8 @@ require File.expand_path('../../state_checker', __FILE__)
|
||||
|
||||
StateChecker.new.check!
|
||||
|
||||
Danbooru::Application.config.action_dispatch.session = {
|
||||
Rails.application.config.action_dispatch.session = {
|
||||
:key => '_danbooru2_session',
|
||||
:secret => File.read(File.expand_path("~/.danbooru/session_secret_key"))
|
||||
}
|
||||
Danbooru::Application.config.secret_token = File.read(File.expand_path("~/.danbooru/secret_token"))
|
||||
Rails.application.config.secret_token = File.read(File.expand_path("~/.danbooru/secret_token"))
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
Danbooru::Application.config.session_store :cookie_store, :key => '_danbooru_session'
|
||||
|
||||
# Use the database for sessions instead of the cookie-based default,
|
||||
# which shouldn't be used to store highly confidential information
|
||||
# (create the session table with "rails generate session_migration")
|
||||
# Danbooru::Application.config.session_store :active_record_store
|
||||
Rails.application.config.session_store :cookie_store, key: '_danbooru_session'
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
#
|
||||
|
||||
# This file contains settings for ActionController::ParamsWrapper which
|
||||
# is enabled by default.
|
||||
|
||||
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
||||
ActiveSupport.on_load(:action_controller) do
|
||||
wrap_parameters format: [:json]
|
||||
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
||||
end
|
||||
|
||||
# Disable root element in JSON by default.
|
||||
# To enable root element in JSON for ActiveRecord objects.
|
||||
ActiveSupport.on_load(:active_record) do
|
||||
self.include_root_in_json = false
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
if Danbooru.config.amazon_ses && Rails.env == "production"
|
||||
Danbooru::Application.config.action_mailer.smtp_settings = {
|
||||
Rails.application.config.action_mailer.smtp_settings = {
|
||||
:address => Danbooru.config.amazon_ses[:smtp_server_name],
|
||||
:user_name => Danbooru.config.amazon_ses[:ses_smtp_user_name],
|
||||
:password => Danbooru.config.amazon_ses[:ses_smtp_password],
|
||||
|
||||
@@ -3,7 +3,7 @@ unless defined?(MEMCACHE)
|
||||
end
|
||||
|
||||
if Rails.env.production?
|
||||
Danbooru::Application.configure do
|
||||
Rails.application.configure do
|
||||
config.cache_store = :dalli_store, Danbooru.config.memcached_servers
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user