Update to rails 3

This commit is contained in:
Tom Hughes 2010-09-01 11:02:58 +01:00
parent 9ff70a861a
commit c9fa49c994
41 changed files with 4214 additions and 2461 deletions

View file

@ -1,3 +0,0 @@
# Stop action controller from automatically parsing XML in request bodies
ActionController::Base.param_parsers.delete Mime::XML

View file

@ -0,0 +1,2 @@
# Stop rails from automatically parsing XML in request bodies
Rails.configuration.middleware.delete ActionDispatch::ParamsParser

View file

@ -3,5 +3,5 @@
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
# Rails.backtrace_cleaner.remove_silencers!
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
# Rails.backtrace_cleaner.remove_silencers!

View file

@ -1,6 +1,6 @@
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# 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'

View file

@ -1,21 +0,0 @@
# Be sure to restart your server when you modify this file.
# These settings change the behavior of Rails 2 apps and will be defaults
# for Rails 3. You can remove this initializer when Rails 3 is released.
if defined?(ActiveRecord)
# Include Active Record class name as root for JSON serialized output.
ActiveRecord::Base.include_root_in_json = true
# Store the full class name (including module namespace) in STI type column.
ActiveRecord::Base.store_full_sti_class = true
end
ActionController::Routing.generate_best_match = false
# Use ISO 8601 format for JSON serialized times and dates.
ActiveSupport.use_standard_json_time_format = true
# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
# if you're including raw json in an HTML page.
ActiveSupport.escape_html_entities_in_json = false

View file

@ -2,6 +2,6 @@
# Your secret key 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,
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
ActionController::Base.cookie_verifier_secret = '67881c9e6670d9b55b43885ea8eab34e32865ce436bdbde73e1967a11a26674906736de0aa1a0d24edf8ebcb653e1735413e6fd24e1201338e397d4a2392c614';
OpenStreetMap::Application.config.secret_token = '67881c9e6670d9b55b43885ea8eab34e32865ce436bdbde73e1967a11a26674906736de0aa1a0d24edf8ebcb653e1735413e6fd24e1201338e397d4a2392c614'

View file

@ -1,17 +1,8 @@
# Be sure to restart your server when you modify this file.
# Your secret key for verifying cookie session data integrity.
# If you change this key, all old sessions 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.
ActionController::Base.session = {
:key => '_osm_session',
:secret => 'd886369b1e709c61d1f9fcb07384a2b96373c83c01bfc98c6611a9fe2b6d0b14215bb360a0154265cccadde5489513f2f9b8d9e7b384a11924f772d2872c2a1f'
}
OpenStreetMap::Application.config.session_store :cookie_store, :key => '_osm_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")
unless STATUS == :database_offline or STATUS == :database_readonly
ActionController::Base.session_store = :sql_session_store
end
# OpenStreetMap::Application.config.session_store :active_record_store

View file

@ -1,9 +1,8 @@
# Work out which session store adapter to use
environment = Rails.configuration.environment
adapter = Rails.configuration.database_configuration[environment]["adapter"]
adapter = Rails.configuration.database_configuration[Rails.env]["adapter"]
session_class = adapter + "_session"
# Configure SqlSessionStore
unless STATUS == :database_offline
unless STATUS == :database_offline
SqlSessionStore.session_class = session_class.camelize.constantize
end