Sha256: 7c617aa651cd2ee6d48dbcfc633673b48bf6bd9773d13eeaf8c653ec7a6f0819

Contents?: true

Size: 470 Bytes

Versions: 21

Compression:

Stored size: 470 Bytes

Contents

# ensures compatibility with CanCan 1.5+ and 1.4-
module CanTango
  class PermitEngine < Engine
    module Compatibility
      def rules
        return rules_1_5 if rules_1_5
        return rules_1_4 if rules_1_4
        raise "CanCan ability.rules could not be found. Possibly due to CanCan API change since 1.5"
      end

      def rules_1_5
        ability.send :rules
      end

      def rules_1_4
        ability.send :can_definitions
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
cantango-0.9.4.7 lib/cantango/permit_engine/compatibility.rb
cantango-0.9.4.6 lib/cantango/permit_engine/compatibility.rb
cantango-0.9.4.5 lib/cantango/permit_engine/compatibility.rb
cantango-0.9.4.3 lib/cantango/permit_engine/compatibility.rb
cantango-0.9.4.2 lib/cantango/permit_engine/compatibility.rb
cantango-0.9.4.1 lib/cantango/permit_engine/compatibility.rb
cantango-0.9.4 lib/cantango/permit_engine/compatibility.rb
cantango-0.9.3.2 lib/cantango/permit_engine/compatibility.rb
cantango-0.8.9.5 lib/cantango/permit_engine/compatibility.rb
cantango-0.8.9.4 lib/cantango/permit_engine/compatibility.rb
cantango-0.8.9.3 lib/cantango/permit_engine/compatibility.rb
cantango-0.8.9.2 lib/cantango/permit_engine/compatibility.rb
cantango-0.8.9.1 lib/cantango/permit_engine/compatibility.rb
cantango-0.8.9 lib/cantango/permit_engine/compatibility.rb
cantango-0.8.8.1 lib/cantango/permit_engine/compatibility.rb
cantango-0.8.8 lib/cantango/permit_engine/compatibility.rb
cantango-0.8.7 lib/cantango/permit_engine/compatibility.rb
cantango-0.8.6.2 lib/cantango/permit_engine/compatibility.rb
cantango-0.8.6.1 lib/cantango/permit_engine/compatibility.rb
cantango-0.8.6 lib/cantango/permit_engine/compatibility.rb