Sha256: f18f2a7c64b078b9a6eface34f1407ac41adb7675aa8a775a8d5ab7bdb18ce39

Contents?: true

Size: 929 Bytes

Versions: 3

Compression:

Stored size: 929 Bytes

Contents

module Condo
	class Engine < ::Rails::Engine
		
		
		#
		# Define the base configuration options
		#
		#config.before_initialize do |app|						# Rails.configuration
		#	app.config.condo = ActiveSupport::OrderedOptions.new
		#	app.config.condo.providers = ActiveSupport::OrderedOptions.new
		#end
		
		
		config.autoload_paths << File.expand_path("../../../lib", __FILE__)
		
		#
		# Set the proper error types for Rails.
		#
		initializer "load http errors" do |app|
			config.after_initialize do
				responses = {
					"Condo::Errors::MissingFurniture" => :not_found,
					"Condo::Errors::LostTheKeys" => :forbidden,
					"Condo::Errors::NotYourPlace" => :unauthorized
				}
				if rescue_responses = config.action_dispatch.rescue_responses			# Rails 3.2+
					rescue_responses.update(responses)
				else
					ActionDispatch::ShowExceptions.rescue_responses.update(responses)	# Rails 3.0/3.1
				end
			end
		end
		
		
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
condo-1.0.1 lib/condo/engine.rb
condo-1.0.0 lib/condo/engine.rb
condo-0.0.1 lib/condo/engine.rb