diff --git a/lib/washout_builder.rb b/lib/washout_builder.rb index e033fea..e090f80 100644 --- a/lib/washout_builder.rb +++ b/lib/washout_builder.rb @@ -28,11 +28,22 @@ def wash_out(controller_name, options={}) Mime::Type.register "application/soap+xml", :soap -ActiveRecord::Base.send :extend, WashOut::Model if defined?(ActiveRecord) -WashOut::Dispatcher::SOAPError.send :include, ActiveModel::MassAssignmentSecurity +ActiveRecord::Base.send :extend, WashOut::Model if defined?(ActiveRecord) && defined?(WashOut::Model) +ActiveRecord::Base.send :extend, WashOut::Rails::ActiveRecord if defined?(ActiveRecord) && defined?(WashOut::Rails::ActiveRecord) +WashOut::Dispatcher::SOAPError.send :include, ActiveModel::MassAssignmentSecurity if defined?(WashOut::Dispatcher) +WashOut::SOAPError.send :include, ActiveModel::MassAssignmentSecurity if defined?(WashOut::SOAPError) -WashOut::SOAP::ClassMethods.class_eval do - alias_method :original_soap_action, :soap_action + +if defined?(WashOut::Soap) + WashOut::SOAP::ClassMethods.class_eval do + alias_method :original_soap_action, :soap_action + end +end + +if defined?(WashOut::Rails::Controller) + WashOut::Rails::Controller::ClassMethods.class_eval do + alias_method :original_soap_action, :soap_action + end end ActionController::Renderers.add :soap do |what, options| diff --git a/lib/washout_builder/engine.rb b/lib/washout_builder/engine.rb index 5a2325a..6c9bdb1 100644 --- a/lib/washout_builder/engine.rb +++ b/lib/washout_builder/engine.rb @@ -6,7 +6,8 @@ class Engine < ::Rails::Engine match "/washout" => "washout_builder#all", :via => :get, :format => false end if app.config.wash_out[:catch_xml_errors] - app.config.middleware.insert_after 'ActionDispatch::ShowExceptions', WashOut::Middleware + app.config.middleware.insert_after 'ActionDispatch::ShowExceptions', WashOut::Middleware if defined?(WashOut::Middleware) + app.config.middleware.insert_after 'ActionDispatch::ShowExceptions', WashOut::Middlewares::Catcher if defined?(WashOut::Middlewares::Catcher) end end end diff --git a/lib/washout_builder/soap.rb b/lib/washout_builder/soap.rb index 6d5e48d..1b6e4ec 100644 --- a/lib/washout_builder/soap.rb +++ b/lib/washout_builder/soap.rb @@ -3,7 +3,8 @@ module WashoutBuilder module SOAP extend ActiveSupport::Concern - include WashOut::SOAP + include WashOut::SOAP if defined?(WashOut::SOAP) + include WashOut::Rails::Controller if defined?(WashOut::Rails::Controller) module ClassMethods @@ -27,8 +28,8 @@ def soap_action(action, options={}) included do - include WashOut::Configurable - include WashOut::Dispatcher + include WashOut::Configurable if defined?(WashOut::Configurable) + include WashOut::Dispatcher if defined?(WashOut::Dispatcher) include WashoutBuilder::Dispatcher self.soap_actions = {} end diff --git a/lib/washout_builder/type.rb b/lib/washout_builder/type.rb index da1a5cb..afd11b3 100644 --- a/lib/washout_builder/type.rb +++ b/lib/washout_builder/type.rb @@ -1,6 +1,5 @@ module WashoutBuilder - class Type < WashOut::Type - + class Type BASIC_TYPES=[ "string", diff --git a/lib/washout_builder/version.rb b/lib/washout_builder/version.rb index 5de9161..e80ab65 100644 --- a/lib/washout_builder/version.rb +++ b/lib/washout_builder/version.rb @@ -1,3 +1,3 @@ module WashoutBuilder - VERSION = "0.6.2" + VERSION = "0.7.0" end