app/controllers/comments_controller.rb
# Check to see if the ultimate_parent is a Work, and if so, if it allows anon comments
Check to see if the ultimate_parent is a Work, and if so, if it allows anon comments
Check to see if the ultimate_parent is a Work and if so if it allows anon comments
def check_anonymous_comment_preference
    parent =  find_parent
    if parent.respond_to?(:anon_commenting_disabled) && parent.anon_commenting_disabled && !logged_in?
      flash[:error] = ts("Sorry, this work doesn't allow non-Archive users to comment.")
      redirect_to work_path(parent)
    end
  end
def check_anonymous_comment_preference parent = find_parent if parent . respond_to? ( :anon_commenting_disabled ) && parent . anon_commenting_disabled && ! logged_in? flash [ :error ] = ts ( "Sorry, this work doesn't allow non-Archive users to comment." ) redirect_to work_path ( parent ) end end
Check to see if the ultimate_parent is a Work, and if so, if it allows anon comments
Check to see if the ultimate_parent is a Work and if so if it allows anon comments