Class: RbacRls::Generators::GroupPermissionGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Rails::Generators::Migration, GeneratorHelpers
Defined in:
lib/generators/rbac_rls/group_permission_generator.rb

Instance Attribute Summary collapse

Attributes included from GeneratorHelpers

#attributes, #options

Instance Method Summary collapse

Instance Attribute Details

#time_nowObject

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_templateObject



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}#{options[:identifier]}".underscore
  # byebug
  migration_template('../templates/group_permission_migration.rb',
                     File.join('db/migrate', "create_#{full_name}_gpolicy.rb"))
end