Fixed codeclimate issues and removed unnecessary files

This commit is contained in:
Sergei Tsõganov 2022-03-21 11:23:42 +02:00 committed by Sergei Tsõganov
parent f59c6ee5c3
commit d50c3f0b45
12 changed files with 12 additions and 105 deletions

View file

@ -3,7 +3,10 @@ class Action < ApplicationRecord
belongs_to :user
belongs_to :contact, optional: true
has_many :subactions, class_name: 'Action', foreign_key: 'bulk_action_id', dependent: :destroy
has_many :subactions, class_name: 'Action',
foreign_key: 'bulk_action_id',
inverse_of: :action,
dependent: :destroy
belongs_to :bulk_action, class_name: 'Action', optional: true
validates :operation, inclusion: { in: proc { |action| action.class.valid_operations } }
@ -36,3 +39,4 @@ class Action < ApplicationRecord
end
end
end