Skip to content

Commit

Permalink
Run ActiveRecord generators by default
Browse files Browse the repository at this point in the history
After enabling Zeitwerk mode I unintentionally disabled ORM default
generators (9f1b6b0).

This commit brings them back.

[fixes #351]
  • Loading branch information
tute committed Aug 15, 2020
1 parent 622d74f commit 587f8a4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/merit/generators/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions lib/merit/generators/merit_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
4 changes: 4 additions & 0 deletions lib/merit/generators/remove_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 587f8a4

Please sign in to comment.