Sha256: 35f47cbb454cc84d7496e02d3217fd1b6ee4d447e4fe457aec18f377487c5636
Contents?: true
Size: 997 Bytes
Versions: 23
Compression:
Stored size: 997 Bytes
Contents
module Plutonium module Core module Actions class Collection delegate_missing_to :@collection def initialize(collection = {}) @collection = collection end def permitted_for(policy) Collection.new(@collection.select { |name, action| policy.send_with_report :"#{action.name}?" }) end def collection_actions Collection.new(@collection.select { |name, action| action.collection_action? }) end def collection_record_actions Collection.new(@collection.select { |name, action| action.collection_record_action? }) end def record_actions Collection.new(@collection.select { |name, action| action.record_action? }) end def bulk_actions Collection.new(@collection.select { |name, action| action.bulk_action? }) end def values super.sort_by { |value| value.position } end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems