Sha256: 6e89c4f1f9c03bee7cb6797690198ef414fd11df896a9714a63d3cbbf2cd0b8c

Contents?: true

Size: 331 Bytes

Versions: 2

Compression:

Stored size: 331 Bytes

Contents

module Cancannible::PreloadAdapter
  extend ActiveSupport::Concern

  included do
    # Tap Ability.new to first preload permissions via Cancannible
    alias_method :cancan_initialize, :initialize
    def initialize(user)
      Cancannible::Preloader.preload_abilities!(user, self)
      cancan_initialize(user)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cancannible-2.1.0 lib/cancannible/preload_adapter.rb
cancannible-2.0.0 lib/cancannible/preload_adapter.rb