Sha256: 834439bddb7b4f0233e1084ffe422e6c20b8a1f751db929b6849d92e54bdedf6

Contents?: true

Size: 661 Bytes

Versions: 23

Compression:

Stored size: 661 Bytes

Contents

module HydraEditor
  module Form
    module Permissions
      extend ActiveSupport::Concern

      module ClassMethods
        def build_permitted_params
          permitted = super
          permitted << { permissions_attributes: [:type, :name, :access, :id, :_destroy] }
          permitted
        end
      end

      # This is required so that fields_for will draw a nested form.
      # See ActionView::Helpers#nested_attributes_association?
      #   https://github.com/rails/rails/blob/a04c0619617118433db6e01b67d5d082eaaa0189/actionview/lib/action_view/helpers/form_helper.rb#L1890
      delegate :permissions_attributes=, to: :model
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
hydra-editor-6.3.0 app/forms/hydra_editor/form/permissions.rb
hydra-editor-6.2.0 app/forms/hydra_editor/form/permissions.rb
hydra-editor-6.1.0 app/forms/hydra_editor/form/permissions.rb
hydra-editor-6.0.0 app/forms/hydra_editor/form/permissions.rb
hydra-editor-5.0.5 app/forms/hydra_editor/form/permissions.rb
hydra-editor-5.0.4 app/forms/hydra_editor/form/permissions.rb
hydra-editor-5.0.3 app/forms/hydra_editor/form/permissions.rb
hydra-editor-5.0.2 app/forms/hydra_editor/form/permissions.rb
hydra-editor-5.0.1 app/forms/hydra_editor/form/permissions.rb
hydra-editor-5.0.0 app/forms/hydra_editor/form/permissions.rb
hydra-editor-4.0.2 app/forms/hydra_editor/form/permissions.rb
hydra-editor-4.0.1 app/forms/hydra_editor/form/permissions.rb
hydra-editor-3.4.0 app/forms/hydra_editor/form/permissions.rb
hydra-editor-3.4.0.beta app/forms/hydra_editor/form/permissions.rb
hydra-editor-3.3.2 app/forms/hydra_editor/form/permissions.rb
hydra-editor-3.3.1 app/forms/hydra_editor/form/permissions.rb
hydra-editor-3.2.1 app/forms/hydra_editor/form/permissions.rb
hydra-editor-3.2.0 app/forms/hydra_editor/form/permissions.rb
hydra-editor-3.1.2 app/forms/hydra_editor/form/permissions.rb
hydra-editor-3.1.1 app/forms/hydra_editor/form/permissions.rb