D
DemetriusOlsen
I'm working on a method but the results are "the opposite" of what I
want to happen. Here's what I have in my model:
after_update :foo
def foo
self.scores.wherestandard_id => self.standard_ids).each do |
score|
score.destroy
end
end
.... which actually deletes the scores I want to keep. What I want to
do is something like:
self.scores - self.scores.wherestandard_id =>
self.standard_ids).each do...
OR
a = self.scores
b = self.scores.wherestandard_id => self.standard_ids)
a - b = c
c.each do...
OR
self.scores.reject(self.scores.wherestandard_id =>
self.standard_ids)).each do...
Any help is greatly appreciated! Thanks in advance
want to happen. Here's what I have in my model:
after_update :foo
def foo
self.scores.wherestandard_id => self.standard_ids).each do |
score|
score.destroy
end
end
.... which actually deletes the scores I want to keep. What I want to
do is something like:
self.scores - self.scores.wherestandard_id =>
self.standard_ids).each do...
OR
a = self.scores
b = self.scores.wherestandard_id => self.standard_ids)
a - b = c
c.each do...
OR
self.scores.reject(self.scores.wherestandard_id =>
self.standard_ids)).each do...
Any help is greatly appreciated! Thanks in advance