Class: ActsAsTrackable::Generators::ObjectActivityGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- ActsAsTrackable::Generators::ObjectActivityGenerator
- Defined in:
- lib/generators/acts_as_trackable/object_activity_generator.rb
Instance Method Summary collapse
Instance Method Details
#create_migration ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/generators/acts_as_trackable/object_activity_generator.rb', line 9 def create_migration migration_file_name = "create_object_activity.rb" = Time.now.utc.strftime("%Y%m%d%H%M%S") destination = File.join('db', 'migrate', "#{}_#{migration_file_name}") template migration_file_name, destination end |
#create_model_file ⇒ Object
17 18 19 |
# File 'lib/generators/acts_as_trackable/object_activity_generator.rb', line 17 def create_model_file template 'object_activity.rb', File.join('app/models', class_path, "#{file_name}.rb") end |