vital-edu/sala-de-espera

View on GitHub
app/models/role.rb

Summary

Maintainability
A
0 mins
Test Coverage

Missing top-level class documentation comment.
Open

class Role < ApplicationRecord
Severity: Minor
Found in app/models/role.rb by rubocop

This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

Example:

# bad
class Person
  # ...
end

# good
# Description/Explanation of Person class
class Person
  # ...
end

Prefer annotated tokens (like %<foo>s</foo>) over template tokens (like %{foo}).
Open

  validates :name, inclusion: { in: %w(client manager employee), message: '%{value} is not a permitted role' }
Severity: Minor
Found in app/models/role.rb by rubocop

Use a consistent style for named format string tokens.

Note: unannotated style cop only works for strings which are passed as arguments to those methods: sprintf, format, %. The reason is that unannotated format is very similar to encoded URLs or Date/Time formatting strings.

Example: EnforcedStyle: annotated (default)

# bad
format('%{greeting}', greeting: 'Hello')
format('%s', 'Hello')

# good
format('%<greeting>s', greeting: 'Hello')</greeting>

Example: EnforcedStyle: template

# bad
format('%<greeting>s', greeting: 'Hello')
format('%s', 'Hello')

# good
format('%{greeting}', greeting: 'Hello')</greeting>

Example: EnforcedStyle: unannotated

# bad
format('%<greeting>s', greeting: 'Hello')
format('%{greeting}', 'Hello')

# good
format('%s', 'Hello')</greeting>

Line is too long. [110/80]
Open

  validates :name, inclusion: { in: %w(client manager employee), message: '%{value} is not a permitted role' }
Severity: Minor
Found in app/models/role.rb by rubocop

Prefer has_many :through to has_and_belongs_to_many.
Open

  has_and_belongs_to_many :users, join_table: :users_roles
Severity: Minor
Found in app/models/role.rb by rubocop

This cop checks for the use of the hasandbelongstomany macro.

Example:

# bad
# has_and_belongs_to_many :ingredients

# good
# has_many :ingredients, through: :recipe_ingredients

There are no issues that match your filters.

Category
Status