Sha256: 93a2d63d8652ceb0d259ffbaa8eaeb48c82bd7f65ace298e33aae7857e801b60

Contents?: true

Size: 377 Bytes

Versions: 23

Compression:

Stored size: 377 Bytes

Contents

class HydraEditor::ControllerResource < CanCan::ControllerResource
  def find_resource
    ActiveFedora::Base.find(id_param)
  end

  def resource_class
    raise HydraEditor::InvalidType, 'Lost the type' unless has_valid_type?
    type_param.constantize
  end

  def has_valid_type?
    HydraEditor.valid_model? type_param
  end

  def type_param
    @params[:type]
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

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