Class: Guacamole::Generators::CallbacksGenerator
- Inherits:
-
Base
- Object
- Rails::Generators::NamedBase
- Base
- Guacamole::Generators::CallbacksGenerator
- Defined in:
- lib/rails/generators/guacamole/callbacks/callbacks_generator.rb
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#create_callback_file ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/rails/generators/guacamole/callbacks/callbacks_generator.rb', line 14 def create_callback_file model_file_name = ([:model_class] || class_name).underscore inject_into_file "app/models/#{model_file_name}.rb", "\n\n callbacks :#{class_name.underscore}_callbacks", after: 'include Guacamole::Model' template 'callbacks.rb.tt', File.join('app/callbacks', class_path, "#{file_name}_callbacks.rb") end |