Class: Para::Acl::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Para::Acl::InstallGenerator
- Defined in:
- lib/generators/para/acl/install/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_role_mixin_to_admin ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/generators/para/acl/install/install_generator.rb', line 11 def add_role_mixin_to_admin admin_user_class_file_path = File.join( 'app', 'models', "#{ Para.config.acl.admin_user_class.underscore }.rb" ) inject_into_file admin_user_class_file_path, after: /< (ActiveRecord::Base|ApplicationRecord)/ do "\n has_admin_role" end end |
#add_role_to_super_admins ⇒ Object
21 22 23 |
# File 'lib/generators/para/acl/install/install_generator.rb', line 21 def add_role_to_super_admins rake 'para:acl:authorize_admins' end |
#install_migrations ⇒ Object
6 7 8 9 |
# File 'lib/generators/para/acl/install/install_generator.rb', line 6 def install_migrations rake 'para_acl_engine:install:migrations' rake 'db:migrate' end |