acts_as_sourceable 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
data/acts_as_sourceable.gemspec
CHANGED
@@ -101,7 +101,7 @@ module ActsAsSourceable
|
|
101
101
|
existing_source_ids = sourceable_institutions.pluck('holding_institution_id')
|
102
102
|
|
103
103
|
# Delete those that have been removed
|
104
|
-
condition = holding_institution_ids.any? ? "holding_institution_id NOT IN (?)" : nil # Can't use "NOT IN (?)" for an empty array because the result is always false
|
104
|
+
condition = holding_institution_ids.any? ? ["holding_institution_id NOT IN (?)", existing_source_ids] : nil # Can't use "NOT IN (?)" for an empty array because the result is always false
|
105
105
|
SourceableInstitution.where(:sourceable_type => self.class.name, :sourceable_id => self.id).delete_all(condition)
|
106
106
|
|
107
107
|
# Add those that are not present
|