diff options
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/acts_as_xapian.rb | 25 | ||||
-rw-r--r-- | config/initializers/alaveteli.rb | 3 | ||||
-rw-r--r-- | config/initializers/has_tag_string.rb | 2 | ||||
-rw-r--r-- | config/initializers/rails_security_patches.rb | 22 | ||||
-rw-r--r-- | config/initializers/strip_attributes.rb | 2 | ||||
-rw-r--r-- | config/initializers/theme_loader.rb | 4 |
6 files changed, 33 insertions, 25 deletions
diff --git a/config/initializers/acts_as_xapian.rb b/config/initializers/acts_as_xapian.rb new file mode 100644 index 000000000..f82193c85 --- /dev/null +++ b/config/initializers/acts_as_xapian.rb @@ -0,0 +1,25 @@ +# acts_as_xapian/init.rb: +# +# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. +# Email: hello@mysociety.org; WWW: http://www.mysociety.org/ + +# We're moving plugins out of vendor/plugins, since keeping them there +# is deprecated as of Rails 3.2, and the xapiandbs directory should be +# moved out of there along with the plugin itself. + +old_xapiandbs_path = Rails.root.join('vendor', + 'plugins', + 'acts_as_xapian', + 'xapiandbs') + +current_xapiandbs_path = Rails.root.join('lib', + 'acts_as_xapian', + 'xapiandbs') + +if File.exists? old_xapiandbs_path + unless File.exists? current_xapiandbs_path + File.rename old_xapiandbs_path, current_xapiandbs_path + end +end + +require 'acts_as_xapian/acts_as_xapian' diff --git a/config/initializers/alaveteli.rb b/config/initializers/alaveteli.rb index 631251b87..cabe96efa 100644 --- a/config/initializers/alaveteli.rb +++ b/config/initializers/alaveteli.rb @@ -10,7 +10,7 @@ load "debug_helpers.rb" load "util.rb" # Application version -ALAVETELI_VERSION = '0.15' +ALAVETELI_VERSION = '0.16' # Add new inflection rules using the following format # (all these examples are active by default): @@ -50,7 +50,6 @@ require 'normalize_string' require 'alaveteli_file_types' require 'alaveteli_localization' require 'message_prominence' -require 'actionmailer_patches' require 'theme' AlaveteliLocalization.set_locales(AlaveteliConfiguration::available_locales, diff --git a/config/initializers/has_tag_string.rb b/config/initializers/has_tag_string.rb new file mode 100644 index 000000000..5fa33cc70 --- /dev/null +++ b/config/initializers/has_tag_string.rb @@ -0,0 +1,2 @@ +require 'has_tag_string/has_tag_string' + diff --git a/config/initializers/rails_security_patches.rb b/config/initializers/rails_security_patches.rb deleted file mode 100644 index b7f013d04..000000000 --- a/config/initializers/rails_security_patches.rb +++ /dev/null @@ -1,22 +0,0 @@ -# Temporary patches for Rails security alert made on 03/12/2013 - -# CVE-2013-6414 https://groups.google.com/forum/#!topic/rubyonrails-security/A-ebV4WxzKg - -ActiveSupport.on_load(:action_view) do - ActionView::LookupContext::DetailsKey.class_eval do - class << self - alias :old_get :get - - def get(details) - if details[:formats] - details = details.dup - syms = Set.new Mime::SET.symbols - details[:formats] = details[:formats].select { |v| - syms.include? v - } - end - old_get details - end - end - end -end diff --git a/config/initializers/strip_attributes.rb b/config/initializers/strip_attributes.rb new file mode 100644 index 000000000..25f70b2f3 --- /dev/null +++ b/config/initializers/strip_attributes.rb @@ -0,0 +1,2 @@ +require 'strip_attributes/strip_attributes' +ActiveRecord::Base.extend(StripAttributes) diff --git a/config/initializers/theme_loader.rb b/config/initializers/theme_loader.rb index b3ae11e1e..9c79e513c 100644 --- a/config/initializers/theme_loader.rb +++ b/config/initializers/theme_loader.rb @@ -3,7 +3,9 @@ $alaveteli_route_extensions = [] def require_theme(theme_name) - theme_main_include = File.expand_path "../../../vendor/plugins/#{theme_name}/lib/alavetelitheme.rb", __FILE__ + theme_lib = Rails.root.join 'lib', 'themes', theme_name, 'lib' + $LOAD_PATH.unshift theme_lib.to_s + theme_main_include = Rails.root.join theme_lib, "alavetelitheme.rb" if File.exists? theme_main_include require theme_main_include end |