From: Tom Hughes Date: Sat, 21 Jan 2012 00:40:09 +0000 (+0000) Subject: Update to rails 3.2.0 X-Git-Tag: live~6431 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/ee411e5154cedd644fe54ccb29d64b6d18cb9bde Update to rails 3.2.0 --- diff --git a/Gemfile b/Gemfile index a75a9279a..4556a6d06 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'http://rubygems.org' # Require rails -gem 'rails', '3.1.3' +gem 'rails', '3.2.0' # Require the postgres database driver gem 'pg' @@ -48,8 +48,8 @@ end # Gems needed for compiling assets group :assets do - gem 'sass-rails', " ~> 3.1.0" - gem 'coffee-rails', "~> 3.1.0" - gem 'uglifier' + gem 'sass-rails', '~> 3.2.3' + gem 'coffee-rails', '~> 3.2.1' + gem 'uglifier', '>= 1.0.3' gem 'therubyracer' end diff --git a/Gemfile.lock b/Gemfile.lock index 23c4297ab..60f7ba699 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,40 +2,39 @@ GEM remote: http://rubygems.org/ specs: SystemTimer (1.2.3) - actionmailer (3.1.3) - actionpack (= 3.1.3) - mail (~> 2.3.0) - actionpack (3.1.3) - activemodel (= 3.1.3) - activesupport (= 3.1.3) + actionmailer (3.2.0) + actionpack (= 3.2.0) + mail (~> 2.4.0) + actionpack (3.2.0) + activemodel (= 3.2.0) + activesupport (= 3.2.0) builder (~> 3.0.0) erubis (~> 2.7.0) - i18n (~> 0.6) - rack (~> 1.3.5) + journey (~> 1.0.0) + rack (~> 1.4.0) rack-cache (~> 1.1) - rack-mount (~> 0.8.2) rack-test (~> 0.6.1) - sprockets (~> 2.0.3) - activemodel (3.1.3) - activesupport (= 3.1.3) + sprockets (~> 2.1.2) + activemodel (3.2.0) + activesupport (= 3.2.0) builder (~> 3.0.0) - i18n (~> 0.6) - activerecord (3.1.3) - activemodel (= 3.1.3) - activesupport (= 3.1.3) - arel (~> 2.2.1) + activerecord (3.2.0) + activemodel (= 3.2.0) + activesupport (= 3.2.0) + arel (~> 3.0.0) tzinfo (~> 0.3.29) - activeresource (3.1.3) - activemodel (= 3.1.3) - activesupport (= 3.1.3) - activesupport (3.1.3) + activeresource (3.2.0) + activemodel (= 3.2.0) + activesupport (= 3.2.0) + activesupport (3.2.0) + i18n (~> 0.6) multi_json (~> 1.0) addressable (2.2.6) - arel (2.2.1) + arel (3.0.0) builder (3.0.0) - coffee-rails (3.1.1) + coffee-rails (3.2.2) coffee-script (>= 2.2.0) - railties (~> 3.1.0) + railties (~> 3.2.0) coffee-script (2.2.0) coffee-script-source execjs @@ -54,13 +53,14 @@ GEM httpclient (2.2.4) i18n (0.6.0) iconv (0.1) - jquery-rails (1.0.19) - railties (~> 3.0) + journey (1.0.1) + jquery-rails (2.0.0) + railties (>= 3.2.0.beta, < 5.0) thor (~> 0.14) json (1.6.5) libv8 (3.3.10.4) libxml-ruby (2.2.2) - mail (2.3.0) + mail (2.4.1) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) @@ -83,11 +83,9 @@ GEM rack-openid (~> 1.3) pg (0.12.2) polyglot (0.3.3) - rack (1.3.6) + rack (1.4.1) rack-cache (1.1) rack (>= 0.4) - rack-mount (0.8.3) - rack (>= 1.0.0) rack-openid (1.3.1) rack (>= 1.1.0) ruby-openid (>= 2.1.8) @@ -95,21 +93,21 @@ GEM rack rack-test (0.6.1) rack (>= 1.0) - rails (3.1.3) - actionmailer (= 3.1.3) - actionpack (= 3.1.3) - activerecord (= 3.1.3) - activeresource (= 3.1.3) - activesupport (= 3.1.3) + rails (3.2.0) + actionmailer (= 3.2.0) + actionpack (= 3.2.0) + activerecord (= 3.2.0) + activeresource (= 3.2.0) + activesupport (= 3.2.0) bundler (~> 1.0) - railties (= 3.1.3) + railties (= 3.2.0) rails-i18n-updater (1.0.1) actionpack activesupport rails - railties (3.1.3) - actionpack (= 3.1.3) - activesupport (= 3.1.3) + railties (3.2.0) + actionpack (= 3.2.0) + activesupport (= 3.2.0) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) @@ -123,12 +121,11 @@ GEM sanitize (2.0.3) nokogiri (>= 1.4.4, < 1.6) sass (3.1.12) - sass-rails (3.1.5) - actionpack (~> 3.1.0) - railties (~> 3.1.0) - sass (~> 3.1.10) - tilt (~> 1.3.2) - sprockets (2.0.3) + sass-rails (3.2.4) + railties (~> 3.2.0) + sass (>= 3.1.10) + tilt (~> 1.3) + sprockets (2.1.2) hike (~> 1.2) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) @@ -151,7 +148,7 @@ PLATFORMS DEPENDENCIES SystemTimer (>= 1.1.3) - coffee-rails (~> 3.1.0) + coffee-rails (~> 3.2.1) composite_primary_keys (>= 4.1.2) dynamic_form httpclient @@ -163,13 +160,13 @@ DEPENDENCIES oauth-plugin (>= 0.4.0.pre7) open_id_authentication (>= 1.1.0) pg - rails (= 3.1.3) + rails (= 3.2.0) rails-i18n-updater rinku (>= 1.2.2) rmagick sanitize - sass-rails (~> 3.1.0) + sass-rails (~> 3.2.3) therubyracer timecop - uglifier + uglifier (>= 1.0.3) validates_email_format_of (>= 1.5.1) diff --git a/config/application.rb b/config/application.rb index 8c8f4c926..c85f47884 100644 --- a/config/application.rb +++ b/config/application.rb @@ -14,7 +14,7 @@ end if defined?(Bundler) # If you precompile assets before deploying to production, use this line - Bundler.require *Rails.groups(:assets => %w(development test)) + 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 @@ -51,19 +51,25 @@ module OpenStreetMap # Configure sensitive parameters which will be filtered from the log file. config.filter_parameters += [:password, :pass_crypt, :pass_crypt_confirmation] - # Enable the asset pipeline - config.assets.enabled = true - - # Version of your assets, change this if you want to expire all your assets - config.assets.version = '1.0' - - # Use SQL instead of Active Record's schema dumper when creating the test database. + # Use SQL instead of Active Record's schema dumper when creating the database. # 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 unless STATUS == :database_offline config.active_record.schema_format = :sql end + # 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 + + # Enable the asset pipeline + config.assets.enabled = true + + # Version of your assets, change this if you want to expire all your assets + config.assets.version = '1.0' + # Don't eager load models when the database is offline if STATUS == :database_offline config.paths["app/models"].skip_eager_load! diff --git a/config/environments/development.rb b/config/environments/development.rb index 12cf912bc..75f8fee12 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -2,7 +2,7 @@ OpenStreetMap::Application.configure do # 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 + # every request. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. config.cache_classes = false @@ -11,7 +11,6 @@ OpenStreetMap::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 @@ -23,6 +22,13 @@ OpenStreetMap::Application.configure do # 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 diff --git a/config/environments/production.rb b/config/environments/production.rb index 6a1f633ae..95b45339c 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -36,13 +36,16 @@ OpenStreetMap::Application.configure do # See everything in the log (default is :info) # config.log_level = :debug + # Prepend all log lines with the following tags + # config.log_tags = [ :subdomain, :uuid ] + # Use a different log path in production if defined?(LOG_PATH) config.paths["log"] = LOG_PATH end # Use a different logger for distributed setups - # config.logger = SyslogLogger.new + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) # Use a different cache store in production if defined?(MEMCACHE_SERVERS) @@ -72,4 +75,8 @@ OpenStreetMap::Application.configure do # 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 end diff --git a/config/environments/test.rb b/config/environments/test.rb index fe1d1aa78..524cc5137 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -2,9 +2,9 @@ OpenStreetMap::Application.configure do # 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 + # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! + # 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 @@ -29,9 +29,9 @@ OpenStreetMap::Application.configure do # 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 config.active_support.deprecation = :stderr - - # Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets - config.assets.allow_debugging = true end diff --git a/config/initializers/action_mailer.rb b/config/initializers/action_mailer.rb index e6181072b..ad729174f 100644 --- a/config/initializers/action_mailer.rb +++ b/config/initializers/action_mailer.rb @@ -9,10 +9,8 @@ ActionMailer::Base.smtp_settings = { # Monkey patch to allow sending of messages in specific locales module ActionMailer class Base - adv_attr_accessor :locale - def mail_with_locale(*args) - old_locale= I18n.locale + old_locale = I18n.locale begin I18n.locale = @locale diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 9e8b0131f..5d8d9be23 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -8,3 +8,8 @@ # 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| +# inflect.acronym 'RESTful' +# end