1 class AuthenticatedMailerGenerator < Rails::Generator::NamedBase
4 # Check for class naming collisions.
5 m.class_collisions class_path, "#{class_name}Notifier", "#{class_name}NotifierTest", "#{class_name}Observer"
7 # Controller, helper, views, and test directories.
8 m.directory File.join('app/models', class_path)
9 m.directory File.join('app/views', class_path, "#{file_name}_notifier")
10 m.directory File.join('test/unit', class_path)
12 %w( notifier observer ).each do |model_type|
13 m.template "#{model_type}.rb", File.join('app/models',
15 "#{file_name}_#{model_type}.rb")
18 m.template 'notifier_test.rb', File.join('test/unit', class_path, "#{file_name}_notifier_test.rb")
21 %w( activation signup_notification ).each do |action|
22 m.template "#{action}.rhtml",
23 File.join('app/views', "#{file_name}_notifier", "#{action}.rhtml")