Class: RbacRls::Generators::GroupPermissionGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- RbacRls::Generators::GroupPermissionGenerator
- Includes:
- Rails::Generators::Migration, GeneratorHelpers
- Defined in:
- lib/generators/rbac_rls/group_permission_generator.rb
Instance Attribute Summary collapse
-
#time_now ⇒ Object
Returns the value of attribute time_now.
Attributes included from GeneratorHelpers
Instance Method Summary collapse
Instance Attribute Details
#time_now ⇒ Object
Returns the value of attribute time_now.
37 38 39 |
# File 'lib/generators/rbac_rls/group_permission_generator.rb', line 37 def time_now @time_now end |
Instance Method Details
#migration_define_template ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'lib/generators/rbac_rls/group_permission_generator.rb', line 45 def migration_define_template attrs = attributes.map { |i| i.name } str = attrs.join('_') full_name = "#{name}#{[:identifier]}".underscore # byebug migration_template('../templates/group_permission_migration.rb', File.join('db/migrate', "create_#{full_name}_gpolicy.rb")) end |