Module: Outpost::Test

Extended by:
Test
Included in:
Test
Defined in:
lib/outpost/test.rb

Instance Method Summary collapse

Instance Method Details

#create_permissionsObject

Populate the permissions table. Especially useful when using truncation strategy.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/outpost/test.rb', line 9

def create_permissions
  created = []

  Outpost.config.registered_models.each do |model|
    if !Permission.exists?(resource: model)
      created << Permission.create(resource: model)
    end
  end

  created
end