lib/ixtlan/guard/railtie.rb in ixtlan-guard-0.8.2 vs lib/ixtlan/guard/railtie.rb in ixtlan-guard-0.8.3

- old
+ new

@@ -24,11 +24,12 @@ options[:logger] = logger unless defined?(Slf4r) FileUtils.mkdir_p(app.config.guards_dir) app.config.guard = Ixtlan::Guard::Guard.new(options) end - - config.generators do + + gmethod = config.respond_to?(:generators)? :generators : :app_generators + config.send(gmethod) do require 'rails/generators' require 'rails/generators/rails/controller/controller_generator' Rails::Generators::ControllerGenerator.hook_for :guard, :type => :boolean, :default => true do |controller| invoke controller, [ class_name, actions ] end