Class: RbacRls::Generators::CustomMigrationGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- RbacRls::Generators::CustomMigrationGenerator
- Includes:
- Rails::Generators::Migration, GeneratorHelpers
- Defined in:
- lib/generators/rbac_rls/custom_migration_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.
39 40 41 |
# File 'lib/generators/rbac_rls/custom_migration_generator.rb', line 39 def time_now @time_now end |
Instance Method Details
#migration_define_template ⇒ Object
54 55 56 57 58 59 60 61 |
# File 'lib/generators/rbac_rls/custom_migration_generator.rb', line 54 def migration_define_template attrs = attributes.map { |i| i.name } str = attrs.join('_') migration_template('../templates/rls_migration.rb', File.join('db/migrate', "create_#{name.underscore}_#{[:permission_identifier]}_policy.rb") ) end |