dtaniwaki/e2e-tester

View on GitHub
app/models/shared_test_step_set.rb

Summary

Maintainability
A
0 mins
Test Coverage

Specify a :dependent option.
Open

  has_many :user_shared_test_step_sets, inverse_of: :shared_test_step_set
Severity: Minor
Found in app/models/shared_test_step_set.rb by rubocop

This cop looks for has_many or has_one associations that don't specify a :dependent option. It doesn't register an offense if :through option was specified.

Example:

# bad
class User < ActiveRecord::Base
  has_many :comments
  has_one :avatar
end

# good
class User < ActiveRecord::Base
  has_many :comments, dependent: :restrict_with_exception
  has_one :avatar, dependent: :destroy
  has_many :patients, through: :appointments
end

Specify a :dependent option.
Open

  has_many :referred_test_steps, class_name: 'TestStep::StepSet', inverse_of: :shared_test_step_set
Severity: Minor
Found in app/models/shared_test_step_set.rb by rubocop

This cop looks for has_many or has_one associations that don't specify a :dependent option. It doesn't register an offense if :through option was specified.

Example:

# bad
class User < ActiveRecord::Base
  has_many :comments
  has_one :avatar
end

# good
class User < ActiveRecord::Base
  has_many :comments, dependent: :restrict_with_exception
  has_one :avatar, dependent: :destroy
  has_many :patients, through: :appointments
end

Use %i or %I for an array of symbols.
Open

  validates :title, uniqueness: { scope: [:user_id, :type] }, presence: true
Severity: Minor
Found in app/models/shared_test_step_set.rb by rubocop

This cop can check for array literals made up of symbols that are not using the %i() syntax.

Alternatively, it checks for symbol arrays using the %i() syntax on projects which do not want to use that syntax.

Configuration option: MinSize If set, arrays with fewer elements than this value will not trigger the cop. For example, a MinSize of3` will not enforce a style on an array of 2 or fewer elements.

Example: EnforcedStyle: percent (default)

# good
%i[foo bar baz]

# bad
[:foo, :bar, :baz]

Example: EnforcedStyle: brackets

# good
[:foo, :bar, :baz]

# bad
%i[foo bar baz]

There are no issues that match your filters.

Category
Status