Class: Noticed::Generators::ModelGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Noticed::Generators::ModelGenerator
- Includes:
- Rails::Generators::ResourceHelpers
- Defined in:
- lib/generators/noticed/model_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_noticed_model ⇒ Object
21 22 23 |
# File 'lib/generators/noticed/model_generator.rb', line 21 def add_noticed_model inject_into_class model_path, class_name, " include Noticed::Model\n" end |
#done ⇒ Object
25 26 27 |
# File 'lib/generators/noticed/model_generator.rb', line 25 def done readme "README" if behavior == :invoke end |
#generate_notification ⇒ Object
17 18 19 |
# File 'lib/generators/noticed/model_generator.rb', line 17 def generate_notification generate :model, name, "recipient:references{polymorphic}", "type", "params:text", "read_at:datetime", *attributes end |