SpeciesFileGroup/taxonworks

View on GitHub
app/controllers/dashboard_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage

Prefer :moved_permanently over 301 to define HTTP status code.
Open

    redirect_to signin_path, status: 301 and return unless sessions_signed_in?

Enforces use of symbolic or numeric value to define HTTP status.

Example: EnforcedStyle: symbolic (default)

# bad
render :foo, status: 200
render json: { foo: 'bar' }, status: 200
render plain: 'foo/bar', status: 304
redirect_to root_url, status: 301

# good
render :foo, status: :ok
render json: { foo: 'bar' }, status: :ok
render plain: 'foo/bar', status: :not_modified
redirect_to root_url, status: :moved_permanently

Example: EnforcedStyle: numeric

# bad
render :foo, status: :ok
render json: { foo: 'bar' }, status: :not_found
render plain: 'foo/bar', status: :not_modified
redirect_to root_url, status: :moved_permanently

# good
render :foo, status: 200
render json: { foo: 'bar' }, status: 404
render plain: 'foo/bar', status: 304
redirect_to root_url, status: 301

There are no issues that match your filters.

Category
Status