app/controllers/user_training_stories_controller.rb
# Verifies that a user_training_story id is provided as a parameter,
# and that the corresponding training story is *visible* by the current user.
# Otherwise, it redirects to the home page.
# Assigns the @user_training_story instance when successful.
# (Assumes log-in has been enforced elsewhere.)
#
# == Controller Params:
# id: the user_training_story id to be processed by most of the methods (see before filter above)
#
Verifies that a user_training_story id is provided as a parameter,
and that the corresponding training story is *visible* by the current user.
Otherwise, it redirects to the home page.
Assigns the @user_training_story instance when successful.
(Assumes log-in has been enforced elsewhere.)

Controller Params:
id: the user_training_story id to be processed by most of the methods
Verifies that a user_training_story id is provided as a parameter and that the corresponding training story is * visible * by the current user . Otherwise it redirects to the home page . Assigns the @user_training_story instance when successful . ( Assumes log - in has been enforced elsewhere . ) Controller Params : id : the user_training_story id to be processed by most of the methods
def verify_visibility
    set_user_training_story
    unless UserTrainingStoryAccessibility.new( current_user, @user_training_story ).is_visible
      flash[:error] = I18n.t(:invalid_action_request)
      redirect_to( user_training_stories_path() ) and return
    end
  end
def verify_visibility set_user_training_story unless UserTrainingStoryAccessibility . new ( current_user , @user_training_story ) . is_visible flash [ :error ] = I18n . t ( :invalid_action_request ) redirect_to ( user_training_stories_path ( ) ) and return end end
Verifies that a user_training_story id is provided as a parameter,
and that the corresponding training story is *visible* by the current user.
Verifies that a user_training_story id is provided as a parameter and that the corresponding training story is * visible * by the current user .