update configs for rails 4

This commit is contained in:
Reinier Balt 2013-05-11 23:12:20 +02:00
parent d1de2998de
commit 65859807ea
15 changed files with 226 additions and 239 deletions

View file

@ -2,12 +2,9 @@ require File.expand_path('../boot', __FILE__)
require 'rails/all'
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
require 'yaml'
SITE_CONFIG = YAML.load_file(File.join(File.dirname(__FILE__), 'site.yml'))
@ -48,19 +45,10 @@ module Tracksapp
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
# Enforce whitelist mode for mass assignment.
# This will create an empty whitelist of attributes available for mass-assignment for all models
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
# parameters by using an attr_accessible or attr_protected declaration.
config.active_record.whitelist_attributes = true
# Set timezone of dates in database
config.active_record.default_timezone = :utc
# Enable the asset pipeline
config.assets.enabled = true
# Disable loading of the full environment when precompiling assets
config.assets.initialize_on_precompile = false

View file

@ -1,5 +1,3 @@
require 'rubygems'
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

View file

@ -1,10 +1,5 @@
# Load the rails application
# Load the rails application.
require File.expand_path('../application', __FILE__)
if RUBY_VERSION.to_f >= 1.9
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
end
# Initialize the rails application
Tracksapp::Application.initialize!
# Initialize the rails application.
Tracksapp::Application.initialize!

View file

@ -6,8 +6,8 @@ Tracksapp::Application.configure do
# 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.
config.whiny_nils = true
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching
config.consider_all_requests_local = true
@ -19,19 +19,6 @@ Tracksapp::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
# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
config.active_record.auto_explain_threshold_in_seconds = 0.5
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true

View file

@ -1,67 +1,81 @@
Tracksapp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests
# Code is not reloaded between requests.
config.cache_classes = true
# Full error reports are disabled and caching is turned on
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both thread web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
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)
# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
# config.action_dispatch.rack_cache = true
# Disable Rails's static asset server (Apache or nginx will already do this).
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = true
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Don't fallback to assets pipeline if a precompiled asset is missed
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Generate digests for assets URLs
# Generate digests for assets URLs.
config.assets.digest = true
# Defaults to Rails.root.join("public/assets")
# config.assets.manifest = YOUR_PATH
# Version of your assets, change this if you want to expire all your assets.
config.assets.version = '1.0'
# Specifies the header that your server uses for sending files
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# 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
# Set to :debug to see everything in the log.
config.log_level = :info
# Prepend all log lines with the following tags
# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# 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)
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# config.assets.precompile += %w( search.js )
config.assets.precompile += %w( print.css login.css mobile.css )
# Disable delivery errors, bad email addresses will be ignored
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
# Enable threaded mode
# config.threadsafe!
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
# the I18n.default_locale when a translation can not be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
config.active_record.auto_explain_threshold_in_seconds = 0.5
# Disable automatic flushing of the log to improve performance.
# config.autoflush_log = false
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
end

View file

@ -1,5 +1,5 @@
Tracksapp::Application.configure do
# Settings specified here will take precedence over those in config/application.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,32 +7,31 @@ Tracksapp::Application.configure do
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Configure static asset server for tests with Cache-Control for performance
config.serve_static_assets = true
# Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that
# preloads Rails for running tests, you may have to set it to true.
config.eager_load = false
# 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
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates
# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict
# Print deprecation notices to the stderr
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
# Unique cookies and use cookies for session

View 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]

View file

@ -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

View file

@ -1,7 +1,12 @@
# Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
Tracksapp::Application.config.secret_token = SITE_CONFIG["secret_token"] || SecureRandom.hex(64)
# You can use `rake secret` to generate a secure secret key.
# Make sure your secret_key_base is kept private
# if you're sharing your code publicly.
Tracksapp::Application.config.secret_key_base = SITE_CONFIG["secret_token"] || SecureRandom.hex(64)

View file

@ -1,10 +1,3 @@
# Be sure to restart your server when you modify this file.
#Tracksapp::Application.config.session_store :cookie_store, key: '_tracksapp_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")
# Tracksapp::Application.config.session_store :active_record_store
Tracksapp::Application.config.session_store :active_record_store, :key => '_tracks_session_id'
Tracksapp::Application.config.session_store :cookie_store, key: '_tracksapp_session'

View file

@ -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.
ActiveSupport.on_load(:active_record) do
self.include_root_in_json = false
end
# To enable root element in JSON for ActiveRecord objects.
# ActiveSupport.on_load(:active_record) do
# self.include_root_in_json = true
# end

View file

@ -3,57 +3,57 @@ Tracksapp::Application.routes.draw do
root :to => 'todos#index'
match 'login' => 'login#login'
match 'login/expire_session' => 'login#expire_session'
match 'login/check_expiry' => 'login#check_expiry'
match 'logout' => 'login#logout'
post 'login' => 'login#login'
get 'login/expire_session' => 'login#expire_session'
get 'login/check_expiry' => 'login#check_expiry'
get 'logout' => 'login#logout'
match "tickler" => "todos#list_deferred"
match 'review' => "projects#review"
match 'calendar' => "calendar#show"
match 'done' => "stats#done", :as => 'done_overview'
get "tickler" => "todos#list_deferred"
get 'review' => "projects#review"
get 'calendar' => "calendar#show"
get 'done' => "stats#done", :as => 'done_overview'
match 'search' => 'search#index'
match 'search/results' => 'search#results', :via => 'post'
get 'search' => 'search#index'
get 'search/results' => 'search#results', :via => 'post'
match 'data' => "data#index"
match 'data/csv_notes' => 'data#csv_notes'
match 'data/yaml_export' => 'data#yaml_export'
match 'data/xml_export' => 'data#xml_export'
match 'data/csv_actions' => 'data#csv_actions'
get 'data' => "data#index"
get 'data/csv_notes' => 'data#csv_notes'
get 'data/yaml_export' => 'data#yaml_export'
get 'data/xml_export' => 'data#xml_export'
get 'data/csv_actions' => 'data#csv_actions'
match 'integrations' => "integrations#index"
match 'integrations/rest_api' => "integrations#rest_api", :as => 'rest_api_docs'
match 'integrations/cloudmailin' => 'integrations#cloudmailin'
match 'integrations/search_plugin' => "integrations#search_plugin", :as => 'search_plugin'
match 'integrations/google_gadget.xml' => 'integrations#google_gadget', :as => 'google_gadget'
match 'integrations/get_applescript1.js' => 'integrations#get_applescript1'
match 'integrations/get_applescript2.js' => 'integrations#get_applescript2'
match 'integrations/get_quicksilver_applescript.js' => 'integrations#get_quicksilver_applescript'
get 'integrations' => "integrations#index"
get 'integrations/rest_api' => "integrations#rest_api", :as => 'rest_api_docs'
get 'integrations/cloudmailin' => 'integrations#cloudmailin'
get 'integrations/search_plugin' => "integrations#search_plugin", :as => 'search_plugin'
get 'integrations/google_gadget.xml' => 'integrations#google_gadget', :as => 'google_gadget'
get 'integrations/get_applescript1.js' => 'integrations#get_applescript1'
get 'integrations/get_applescript2.js' => 'integrations#get_applescript2'
get 'integrations/get_quicksilver_applescript.js' => 'integrations#get_quicksilver_applescript'
match 'preferences' => "preferences#index"
match 'preferences/render_date_format' => "preferences#render_date_format"
get 'preferences' => "preferences#index"
get 'preferences/render_date_format' => "preferences#render_date_format"
match 'feeds' => "feedlist#index", :as => 'feeds'
match 'feedlist/get_feeds_for_context' => 'feedlist#get_feeds_for_context'
match 'feedlist/get_feeds_for_project' => 'feedlist#get_feeds_for_project'
get 'feeds' => "feedlist#index", :as => 'feeds'
get 'feedlist/get_feeds_for_context' => 'feedlist#get_feeds_for_context'
get 'feedlist/get_feeds_for_project' => 'feedlist#get_feeds_for_project'
match 'stats' => 'stats#index'
match 'stats/actions_done_last12months_data' => 'stats#actions_done_last12months_data'
match 'stats/actions_done_last_years' => 'stats#actions_done_last_years'
match 'stats/actions_done_lastyears_data' => 'stats#actions_done_lastyears_data'
match 'stats/actions_done_last30days_data' => 'stats#actions_done_last30days_data'
match 'stats/actions_completion_time_data' => 'stats#actions_completion_time_data'
match 'stats/actions_running_time_data' => 'stats#actions_running_time_data'
match 'stats/actions_visible_running_time_data' => 'stats#actions_visible_running_time_data'
match 'stats/actions_open_per_week_data' => 'stats#actions_open_per_week_data'
match 'stats/context_total_actions_data' => 'stats#context_total_actions_data'
match 'stats/context_running_actions_data' => 'stats#context_running_actions_data'
match 'stats/actions_day_of_week_all_data' => 'stats#actions_day_of_week_all_data'
match 'stats/actions_day_of_week_30days_data' => 'stats#actions_day_of_week_30days_data'
match 'stats/actions_time_of_day_all_data' => 'stats#actions_time_of_day_all_data'
match 'stats/actions_time_of_day_30days_data' => 'stats#actions_time_of_day_30days_data'
match 'stats/show_selected_actions_from_chart/:id' => 'stats#show_selected_actions_from_chart', :as => 'show_actions_from_chart'
get 'stats' => 'stats#index'
get 'stats/actions_done_last12months_data' => 'stats#actions_done_last12months_data'
get 'stats/actions_done_last_years' => 'stats#actions_done_last_years'
get 'stats/actions_done_lastyears_data' => 'stats#actions_done_lastyears_data'
get 'stats/actions_done_last30days_data' => 'stats#actions_done_last30days_data'
get 'stats/actions_completion_time_data' => 'stats#actions_completion_time_data'
get 'stats/actions_running_time_data' => 'stats#actions_running_time_data'
get 'stats/actions_visible_running_time_data' => 'stats#actions_visible_running_time_data'
get 'stats/actions_open_per_week_data' => 'stats#actions_open_per_week_data'
get 'stats/context_total_actions_data' => 'stats#context_total_actions_data'
get 'stats/context_running_actions_data' => 'stats#context_running_actions_data'
get 'stats/actions_day_of_week_all_data' => 'stats#actions_day_of_week_all_data'
get 'stats/actions_day_of_week_30days_data' => 'stats#actions_day_of_week_30days_data'
get 'stats/actions_time_of_day_all_data' => 'stats#actions_time_of_day_all_data'
get 'stats/actions_time_of_day_30days_data' => 'stats#actions_time_of_day_30days_data'
get 'stats/show_selected_actions_from_chart/:id' => 'stats#show_selected_actions_from_chart', :as => 'show_actions_from_chart'
resources :contexts do
member do
@ -101,14 +101,14 @@ Tracksapp::Application.routes.draw do
post 'add_predecessor'
end
end
match 'todos/tag/:name' => 'todos#tag', :as => :tag
match 'tags.autocomplete' => "todos#tags", :format => 'autocomplete'
get 'todos/tag/:name' => 'todos#tag', :as => :tag
get 'tags.autocomplete' => "todos#tags", :format => 'autocomplete'
match 'todos/done/tag/:name' => "todos#done_tag", :as => :done_tag
match 'todos/all_done/tag/:name' => "todos#all_done_tag", :as => :all_done_tag
match 'auto_complete_for_predecessor' => 'todos#auto_complete_for_predecessor'
match 'mobile' => 'todos#index', :format => 'm'
match 'm' => 'todos#index', :format => 'm'
get 'todos/done/tag/:name' => "todos#done_tag", :as => :done_tag
get 'todos/all_done/tag/:name' => "todos#all_done_tag", :as => :all_done_tag
get 'auto_complete_for_predecessor' => 'todos#auto_complete_for_predecessor'
get 'mobile' => 'todos#index', :format => 'm'
get 'm' => 'todos#index', :format => 'm'
resources :recurring_todos do
member do
@ -130,7 +130,7 @@ Tracksapp::Application.routes.draw do
post 'refresh_token'
end
end
match 'signup' => "users#new"
get 'signup' => "users#new"
resources :notes
resources :preferences