mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
15 lines
365 B
Ruby
15 lines
365 B
Ruby
module Rails
|
|
module Generators
|
|
class ObserverGenerator < NamedBase
|
|
def check_class_collision
|
|
class_collisions "#{class_name}Observer"
|
|
end
|
|
|
|
def create_observer_file
|
|
template 'observer.rb', File.join('app/models', class_path, "#{file_name}_observer.rb")
|
|
end
|
|
|
|
add_and_invoke_test_framework_option!
|
|
end
|
|
end
|
|
end
|