upgraded to rails 3.1.0.rc1

This commit is contained in:
albert
2011-05-24 18:04:25 -04:00
parent 5a668457d2
commit 1c964b5189
11 changed files with 152 additions and 117 deletions

View File

@@ -1,37 +1,40 @@
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Danbooru
class Application < Rails::Application
config.encoding = "utf-8"
config.filter_parameters += [:password]
config.assets.enabled = true
config.autoload_paths += %W(#{config.root}/app/presenters #{config.root}/app/logical)
config.plugins = [:all]
config.time_zone = 'Eastern Time (US & Canada)'
config.encoding = "utf-8"
config.active_record.schema_format = :sql
config.filter_parameters << :password
config.action_view.javascript_expansions[:defaults] = [
"src/lib/jquery-1.6.0.min.js",
"src/lib/jquery-ui-1.8.9.custom.min.js",
"src/lib/jquery.timeout.js",
"src/lib/rails.js",
"src/app/common.js",
"src/app/cookie.js",
"src/app/utility.js",
"src/app/posts.js",
"src/app/comments.js",
"src/app/uploads.js",
"src/app/users.js",
"src/app/favorites.js",
"src/app/post_flags.js",
"src/app/post_appeals.js",
"src/app/post_moderation.js",
"src/app/pools.js",
"src/app/wiki_pages.js",
"src/app/forum_posts.js",
"src/app/notes.js"
]
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# config.action_view.javascript_expansions[:defaults] = [
# "src/lib/jquery-1.6.0.min.js",
# "src/lib/jquery-ui-1.8.9.custom.min.js",
# "src/lib/jquery.timeout.js",
# "src/lib/rails.js",
# "src/app/common.js",
# "src/app/cookie.js",
# "src/app/utility.js",
# "src/app/posts.js",
# "src/app/comments.js",
# "src/app/uploads.js",
# "src/app/users.js",
# "src/app/favorites.js",
# "src/app/post_flags.js",
# "src/app/post_appeals.js",
# "src/app/post_moderation.js",
# "src/app/pools.js",
# "src/app/wiki_pages.js",
# "src/app/forum_posts.js",
# "src/app/notes.js"
# ]
end
end

View File

@@ -1,13 +1,6 @@
require 'rubygems'
# Set up gems listed in the Gemfile.
gemfile = File.expand_path('../../Gemfile', __FILE__)
begin
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
rescue Bundler::GemNotFound => e
STDERR.puts e.message
STDERR.puts "Try running `bundle install`."
exit!
end if File.exist?(gemfile)
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])

View File

@@ -1,9 +1,9 @@
Danbooru::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
@@ -11,7 +11,6 @@ Danbooru::Application.configure do
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_view.debug_rjs = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
@@ -19,4 +18,7 @@ Danbooru::Application.configure do
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
end

View File

@@ -1,7 +1,6 @@
Danbooru::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb
# Settings specified here will take precedence over those in config/application.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
@@ -9,14 +8,19 @@ Danbooru::Application.configure do
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress both stylesheets and JavaScripts
config.assets.js_compressor = :uglifier
config.assets.css_compressor = :scss
# Specifies the header that your server uses for sending files
config.action_dispatch.x_sendfile_header = "X-Sendfile"
# (comment out if your front-end server doesn't support this)
config.action_dispatch.x_sendfile_header = "X-Sendfile" # Use 'X-Accel-Redirect' for nginx
# For nginx:
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
# If you have no front-end server that supports something like X-Sendfile,
# just comment this out and Rails will serve the files
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
# See everything in the log (default is :info)
# config.log_level = :debug
@@ -27,13 +31,12 @@ Danbooru::Application.configure do
# Use a different cache store in production
# config.cache_store = :mem_cache_store
# Disable Rails's static asset server
# In production, Apache or nginx will already do this
config.serve_static_assets = false
# Enable serving of images, stylesheets, and javascripts from an asset server
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false

View File

@@ -1,5 +1,5 @@
Danbooru::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
@@ -7,7 +7,11 @@ Danbooru::Application.configure do
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Log error messages when you accidentally call methods on nil.
# Configure static asset server for tests with Cache-Control for performance
config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
# Log error messages when you accidentally call methods on nil
config.whiny_nils = true
# Show full error reports and disable caching

View File

@@ -1,3 +1,7 @@
# 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|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'

View File

@@ -1,8 +1,8 @@
# Be sure to restart your server when you modify this file.
Danbooru::Application.config.session_store :cookie_store, :key => '_config_session'
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 "rake db:sessions:create")
# Config::Application.config.session_store :active_record_store
# (create the session table with "rails generate session_migration")
# Danbooru::Application.config.session_store :active_record_store

View File

@@ -0,0 +1,12 @@
# Be sure to restart your server when you modify this file.
#
# This file contains the settings for ActionController::ParametersWrapper
# which will be enabled by default in the upcoming version of Ruby on Rails.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActionController::Base.wrap_parameters format: [:json]
# Disable root element in JSON by default.
if defined?(ActiveRecord)
ActiveRecord::Base.include_root_in_json = false
end

View File

@@ -1,5 +1,5 @@
# Sample localization file for English. Add more files in this directory for other locales.
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
en:
hello: "Hello world"