Module: Mumuki::Laboratory::Controllers::Content

Extended by:
ActiveSupport::Concern
Included in:
ChaptersController, DiscussionsController, ExercisesController, GuideContainerController
Defined in:
lib/mumuki/laboratory/controllers/content.rb

Instance Method Summary collapse

Instance Method Details

#validate_used_here!Object

ensures contents are in current organization’s path



9
10
11
# File 'lib/mumuki/laboratory/controllers/content.rb', line 9

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