Report.user_id is dependent on :destroy-- no need to iterate over it again
This commit is contained in:
parent
563293be44
commit
832dc1c1e4
|
@ -68,14 +68,6 @@ class User < ActiveRecord::Base
|
||||||
r.save
|
r.save
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
rep = Report.where(user_id: self.id)
|
|
||||||
rep.each do |r|
|
|
||||||
unless r.nil?
|
|
||||||
r.deleted = true
|
|
||||||
r.save
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def login=(login)
|
def login=(login)
|
||||||
|
|
Loading…
Reference in New Issue