Sha256: f329283b82aa4c7210b2d8a573a659020a40e068c002d21e684d73a07d240e12

Contents?: true

Size: 476 Bytes

Versions: 19

Compression:

Stored size: 476 Bytes

Contents

module Mumuki::Laboratory::Controllers::Content
  extend ActiveSupport::Concern

  included do
    before_action :validate_used_here!, only: :show
  end

  # ensures contents are in current organization's path
  def validate_used_here! #TODO refactor subject logic (e.g. we can't move validate_accessible! here because ExerciseSolutionsController does not declare a subject)
    raise Mumuki::Laboratory::NotFoundError unless subject&.used_in?(Organization.current)
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
mumuki-laboratory-5.13.0 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.12.1 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.12.0 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.11.0 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.10.4 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.10.3 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.10.2 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.10.1 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.10.0 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.9.1 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.9.0 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.8.3 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.8.1 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.8.0 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.7.0 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.6.3 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.6.2 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.6.1 lib/mumuki/laboratory/controllers/content.rb
mumuki-laboratory-5.6.0 lib/mumuki/laboratory/controllers/content.rb