Sha256: 60a2fe84a8c2451c22da39722afc385c559b0e2bbd55b50da6e095fc23989ea2

Contents?: true

Size: 740 Bytes

Versions: 103

Compression:

Stored size: 740 Bytes

Contents

module CmAdmin
  module ViewHelpers
    module ActionDropdownHelper
      def available_actions(cm_model, ar_object, action_type)
        if action_type.eql?('custom_actions')
          cm_model.available_actions.select {
            |act| act if act.route_type.eql?('member') &&
                         [:button, :modal].include?(act.display_type) &&
                         act.name.present? &&
                         has_valid_policy(ar_object, act.name)
          }
        else
          cm_model.available_actions.select {
            |act| act if act.action_type.eql?(:default) &&
                         act.name.eql?(action_type)
          } if has_valid_policy(ar_object, action_type)
        end
      end
    end
  end
end

Version data entries

103 entries across 103 versions & 1 rubygems

Version Path
cm-admin-2.4.4 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.4.3 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.4.2 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.4.1 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.4.0 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.3.4 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.3.3 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.3.2 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.3.1 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.3.0 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.2.1 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.2.0 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.1.5 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.1.4 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.1.3 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.1.2 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.1.1 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.1.0 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.0.2 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.0.1 lib/cm_admin/view_helpers/action_dropdown_helper.rb