diff --git a/lib/merit/generators/install_generator.rb b/lib/merit/generators/install_generator.rb index 97dea92a..3cb9fa20 100644 --- a/lib/merit/generators/install_generator.rb +++ b/lib/merit/generators/install_generator.rb @@ -12,6 +12,10 @@ def copy_migrations_and_model template 'merit_point_rules.erb', 'app/models/merit/point_rules.rb' template 'merit_rank_rules.erb', 'app/models/merit/rank_rules.rb' end + + def run_active_record_generators + invoke 'merit:active_record:install' + end end end end diff --git a/lib/merit/generators/merit_generator.rb b/lib/merit/generators/merit_generator.rb index bcc28f6d..f623abdf 100644 --- a/lib/merit/generators/merit_generator.rb +++ b/lib/merit/generators/merit_generator.rb @@ -11,6 +11,10 @@ def inject_merit_content end end + def run_active_record_generators + invoke 'merit:active_record:merit' + end + private def model_exists? diff --git a/lib/merit/generators/remove_generator.rb b/lib/merit/generators/remove_generator.rb index 23f6ebba..70b319b1 100644 --- a/lib/merit/generators/remove_generator.rb +++ b/lib/merit/generators/remove_generator.rb @@ -5,6 +5,10 @@ module Generators class RemoveGenerator < ::Rails::Generators::NamedBase source_root File.expand_path('../templates', __FILE__) + def run_active_record_generators + invoke 'merit:active_record:remove' + end + private def model_exists?