Sha256: f031a35e6d139b3f7ac096c26d878c6a974f0468d076589448bfa76befd6d0cd

Contents?: true

Size: 422 Bytes

Versions: 8

Compression:

Stored size: 422 Bytes

Contents

# Some test helpers

module Outpost
  module Test
    extend self

    # Populate the permissions table.
    # Especially useful when using truncation strategy.
    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
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
outpost-cms-0.1.4 lib/outpost/test.rb
outpost-cms-0.1.3 lib/outpost/test.rb
outpost-cms-0.1.2 lib/outpost/test.rb
outpost-cms-0.1.1 lib/outpost/test.rb
outpost-cms-0.1.0 lib/outpost/test.rb
outpost-cms-0.0.5 lib/outpost/test.rb
outpost-cms-0.0.4 lib/outpost/test.rb
outpost-cms-0.0.3 lib/outpost/test.rb