Class: Dis::Generators::ModelGenerator
- Inherits:
-
Rails::Generators::ModelGenerator
- Object
- Rails::Generators::ModelGenerator
- Dis::Generators::ModelGenerator
- Defined in:
- lib/rails/generators/dis/model/model_generator.rb
Instance Method Summary collapse
- #add_model_extension ⇒ Object
-
#initialize(args, *options) ⇒ ModelGenerator
constructor
A new instance of ModelGenerator.
Constructor Details
#initialize(args, *options) ⇒ ModelGenerator
Returns a new instance of ModelGenerator.
11 12 13 |
# File 'lib/rails/generators/dis/model/model_generator.rb', line 11 def initialize(args, *) super(inject_dis_attributes(args), *) end |
Instance Method Details
#add_model_extension ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/rails/generators/dis/model/model_generator.rb', line 15 def add_model_extension inject_into_file( File.join("app/models", class_path, "#{file_name}.rb"), after: "ActiveRecord::Base\n" ) do " include Dis::Model\n" end end |