check for nil
This commit is contained in:
parent
246efbdaa8
commit
5a4157c563
|
|
@ -673,22 +673,26 @@ module JamRuby
|
|||
OnlinePresence.delete_all(["user_id = ?", self.id])
|
||||
end
|
||||
|
||||
unless online_presences.nil?
|
||||
online_presences.each do |op|
|
||||
new_presence = OnlinePresence.create(self, op, false)
|
||||
self.online_presences << new_presence
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def update_performance_samples(performance_samples)
|
||||
unless self.new_record?
|
||||
PerformanceSample.delete_all(["user_id = ?", self.id])
|
||||
end
|
||||
|
||||
unless performance_samples.nil?
|
||||
performance_samples.each do |ps|
|
||||
new_sample = PerformanceSample.create(self, ps, false)
|
||||
self.performance_samples << new_sample
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# given an array of instruments, update a user's instruments
|
||||
def update_instruments(instruments)
|
||||
|
|
|
|||
Loading…
Reference in New Issue