Class: Trek::Generators::Install::UserGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Trek::Generators::Install::UserGenerator
- Includes:
- Rails::Generators::Migration, Helpers
- Defined in:
- lib/generators/trek/install/user_generator.rb
Constant Summary collapse
- USER_MODEL_CLASS_NAME =
"User".freeze
Instance Method Summary collapse
Instance Method Details
#copy_migration_files ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/generators/trek/install/user_generator.rb', line 25 def copy_migration_files return unless defined?(ActiveRecord) migration_template("migrations/users.rb.erb", "db/migrate/trek_users.rb", migration_class_name:) end |
#inject_trek_to_user_model ⇒ Object
18 19 20 21 22 23 |
# File 'lib/generators/trek/install/user_generator.rb', line 18 def inject_trek_to_user_model inject_into_class user_model_path, USER_MODEL_CLASS_NAME, user_model_injection run "rubocop --autocorrect #{user_model_path}", abort_on_failure: true end |