diff options
Diffstat (limited to 'railties/lib/generators/rails')
-rw-r--r-- | railties/lib/generators/rails/observer/USAGE | 5 | ||||
-rw-r--r-- | railties/lib/generators/rails/observer/observer_generator.rb | 8 | ||||
-rw-r--r-- | railties/lib/generators/rails/observer/templates/observer.rb | 2 |
3 files changed, 3 insertions, 12 deletions
diff --git a/railties/lib/generators/rails/observer/USAGE b/railties/lib/generators/rails/observer/USAGE index 197b5d6e4a..9a20f55a89 100644 --- a/railties/lib/generators/rails/observer/USAGE +++ b/railties/lib/generators/rails/observer/USAGE @@ -2,12 +2,11 @@ Description: Stubs out a new observer. Pass the observer name, either CamelCased or under_scored, as an argument. - The generator creates an observer class in app/models and invokes the - configured test framework. + This generator only invokes your ORM and test framework generators. Example: `./script/generate observer Account` - creates an Account observer and invoke the test framework: + For ActiveRecord and TestUnit it creates: Observer: app/models/account_observer.rb TestUnit: test/unit/account_observer_test.rb diff --git a/railties/lib/generators/rails/observer/observer_generator.rb b/railties/lib/generators/rails/observer/observer_generator.rb index ad058a3172..b336cf41a0 100644 --- a/railties/lib/generators/rails/observer/observer_generator.rb +++ b/railties/lib/generators/rails/observer/observer_generator.rb @@ -1,13 +1,7 @@ module Rails module Generators class ObserverGenerator < NamedBase - check_class_collision :suffix => "Observer" - - def create_observer_file - template 'observer.rb', File.join('app/models', class_path, "#{file_name}_observer.rb") - end - - invoke_for :test_framework + invoke_for :orm, :test_framework end end end diff --git a/railties/lib/generators/rails/observer/templates/observer.rb b/railties/lib/generators/rails/observer/templates/observer.rb deleted file mode 100644 index b9a3004161..0000000000 --- a/railties/lib/generators/rails/observer/templates/observer.rb +++ /dev/null @@ -1,2 +0,0 @@ -class <%= class_name %>Observer < ActiveRecord::Observer -end |