Apply automatic rubocop fixes

This commit is contained in:
Sebastian Serth
2021-05-14 10:51:44 +02:00
parent fe4000916c
commit 6cbecb5b39
440 changed files with 2705 additions and 1853 deletions

View File

@@ -1,22 +1,22 @@
class Tag < ApplicationRecord
# frozen_string_literal: true
class Tag < ApplicationRecord
has_many :exercise_tags
has_many :exercises, through: :exercise_tags
validates_uniqueness_of :name
validates :name, uniqueness: true
def destroy
if (can_be_destroyed?)
if can_be_destroyed?
super
end
end
def can_be_destroyed?
!exercises.any?
exercises.none?
end
def to_s
name
end
end
end