style(rubocop): fix all safe auto correctable offenses

This commit is contained in:
Charlie Smurthwaite
2023-03-16 15:50:53 +00:00
parent 02c93a4850
commit fd289c46fd
204 changed files with 2611 additions and 2486 deletions
+8 -8
View File
@@ -18,10 +18,10 @@ class UserInvite < ApplicationRecord
include HasUUID
validates :email_address, :presence => true, :uniqueness => true, :format => {:with => /@/, :allow_blank => true}
validates :email_address, presence: true, uniqueness: true, format: { with: /@/, allow_blank: true }
has_many :organization_users, :dependent => :destroy, :as => :user
has_many :organizations, :through => :organization_users
has_many :organization_users, dependent: :destroy, as: :user
has_many :organizations, through: :organization_users
default_value :expires_at, -> { 7.days.from_now }
@@ -41,16 +41,16 @@ class UserInvite < ApplicationRecord
def accept(user)
transaction do
self.organization_users.each do |ou|
ou.update(:user => user) || ou.destroy
organization_users.each do |ou|
ou.update(user: user) || ou.destroy
end
self.organization_users.reload
self.destroy
organization_users.reload
destroy
end
end
def reject
self.destroy
destroy
end
end