Duh, no before destroy commit, but this is still not right!
This commit is contained in:
@@ -5,10 +5,12 @@ module Filterable
|
||||
has_and_belongs_to_many :filters
|
||||
|
||||
after_update { filters.touch_all }
|
||||
before_destroy_commit :remove_from_filters
|
||||
before_destroy :remove_from_filters
|
||||
end
|
||||
|
||||
private
|
||||
# FIXME: This is too inefficient to have part of a destroy transaction.
|
||||
# Need to find a way to use a job or a single query.
|
||||
def remove_from_filters
|
||||
filters.each { it.resource_removed self }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user